初步增加重载输入的数据功能

This commit is contained in:
BearXR
2020-01-20 12:31:41 +08:00
parent 4ce68bcd0c
commit a75ffad7f5
6 changed files with 47 additions and 27 deletions

View File

@@ -41,7 +41,7 @@ PODS:
- MBProgressHUD
- SDWebImage
- UIImage-Helpers (~> 0.0.2)
- CRBoxInputView (1.1.5):
- CRBoxInputView (1.1.6):
- Masonry
- GBDeviceInfo (5.4.0):
- GBDeviceInfo/Core (= 5.4.0)
@@ -83,7 +83,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
BearSkill: 4fc922b50c46157b9f8eb15dff19e9904137187b
CRBoxInputView: 40aeedca17d33f7464cc3c3b7d75019ae5a9533b
CRBoxInputView: d790d20166c1aca5561381afeea1b2b67d6c4eac
GBDeviceInfo: ae80eb4243d67e2c68d9290a136593da35071382
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9

View File

@@ -1,6 +1,6 @@
{
"name": "CRBoxInputView",
"version": "1.1.5",
"version": "1.1.6",
"summary": "You can use this widget for verify code, password input or phone number input.",
"description": "TODO: You can use this widget for verify code, password input or phone number input.",
"homepage": "https://github.com/CRAnimation/CRBoxInputView",
@@ -13,7 +13,7 @@
},
"source": {
"git": "https://github.com/CRAnimation/CRBoxInputView.git",
"tag": "1.1.5"
"tag": "1.1.6"
},
"platforms": {
"ios": "8.0"

View File

@@ -41,7 +41,7 @@ PODS:
- MBProgressHUD
- SDWebImage
- UIImage-Helpers (~> 0.0.2)
- CRBoxInputView (1.1.5):
- CRBoxInputView (1.1.6):
- Masonry
- GBDeviceInfo (5.4.0):
- GBDeviceInfo/Core (= 5.4.0)
@@ -83,7 +83,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
BearSkill: 4fc922b50c46157b9f8eb15dff19e9904137187b
CRBoxInputView: 40aeedca17d33f7464cc3c3b7d75019ae5a9533b
CRBoxInputView: d790d20166c1aca5561381afeea1b2b67d6c4eac
GBDeviceInfo: ae80eb4243d67e2c68d9290a136593da35071382
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9

View File

@@ -2,25 +2,25 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@@ -84,6 +84,9 @@ typedef void(^TextDidChangeblock)(NSString * _Nullable text, BOOL isFinished);
- (void)loadAndPrepareView;
- (void)loadAndPrepareViewWithBeginEdit:(BOOL)beginEdit;
// 重载输入的数据
- (void)reloadInputString:(NSString *_Nullable)value;
/**
清空输入
desc: Clear all

View File

@@ -93,6 +93,7 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
_ifNeedBeginEdit = NO;
}
#pragma mark - LoadAndPrepareView
- (void)loadAndPrepareView
{
[self loadAndPrepareViewWithBeginEdit:YES];
@@ -122,7 +123,14 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
}];
// tap
[self addGestureRecognizer:self.tapGR];
if (self.tapGR.view != self) {
[self addGestureRecognizer:self.tapGR];
}
if (![self.textView.text isEqualToString:self.customCellProperty.originValue]) {
self.textView.text = self.customCellProperty.originValue;
[self textDidChange:self.textView];
}
if (beginEdit) {
[self beginEdit];
@@ -137,6 +145,15 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
}
}
#pragma mark - Reload Input View
- (void)reloadInputString:(NSString *_Nullable)value
{
if (![self.textView.text isEqualToString:value]) {
self.textView.text = value;
[self textDidChange:self.textView];
}
}
#pragma mark - UITextFieldDelegate
- (void)textFieldDidBeginEditing:(UITextField *)textField
{