diff --git a/CRBoxInputView.podspec b/CRBoxInputView.podspec index c51864c..d352e27 100644 --- a/CRBoxInputView.podspec +++ b/CRBoxInputView.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'CRBoxInputView' - s.version = '1.2.1' + s.version = '1.2.2' s.summary = 'You can use this widget for verify code, password input or phone number input.' # This description is used to generate tags and improve search results. diff --git a/CRBoxInputView/1.2.2/CRBoxInputView.podspec b/CRBoxInputView/1.2.2/CRBoxInputView.podspec new file mode 100644 index 0000000..d352e27 --- /dev/null +++ b/CRBoxInputView/1.2.2/CRBoxInputView.podspec @@ -0,0 +1,43 @@ +# +# Be sure to run `pod lib lint CRBoxInputView.podspec' to ensure this is a +# valid spec before submitting. +# +# Any lines starting with a # are optional, but their use is encouraged +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = 'CRBoxInputView' + s.version = '1.2.2' + s.summary = 'You can use this widget for verify code, password input or phone number input.' + +# This description is used to generate tags and improve search results. +# * Think: What does it do? Why did you write it? What is the focus? +# * Try to keep it short, snappy and to the point. +# * Write the description between the DESC delimiters below. +# * Finally, don't worry about the indent, CocoaPods strips it! + + s.description = <<-DESC +TODO: You can use this widget for verify code, password input or phone number input. + DESC + + s.homepage = 'https://github.com/CRAnimation/CRBoxInputView' + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'BearRan' => '648070256@qq.com' } + s.source = { :git => 'https://github.com/CRAnimation/CRBoxInputView.git', :tag => s.version.to_s } + # s.social_media_url = 'https://twitter.com/' + + s.ios.deployment_target = '8.0' + + s.source_files = 'PodCode/Classes/**/*' + + # s.resource_bundles = { + # 'CRBoxInputView' => ['CRBoxInputView/Assets/*.png'] + # } + + # s.public_header_files = 'Pod/Classes/**/*.h' + # s.frameworks = 'UIKit', 'MapKit' + # s.dependency 'AFNetworking', '~> 2.3' + s.dependency 'Masonry' +end diff --git a/PodCode/Classes/CRBoxInputCellProperty.h b/PodCode/Classes/CRBoxInputCellProperty.h index 30be9be..1273291 100644 --- a/PodCode/Classes/CRBoxInputCellProperty.h +++ b/PodCode/Classes/CRBoxInputCellProperty.h @@ -45,8 +45,8 @@ typedef void(^ConfigCellShadowBlock)(CALayer *layer); /** cell边框颜色 - 状态:无填充文字,未选中状态时 - 默认:与cellBorderColorFilled相同 + 状态:填充文字后,未选中状态时 + 默认:nil */ @property (copy, nonatomic) UIColor *__nullable cellBorderColorFilled; diff --git a/PodCode/Classes/CRBoxInputView.h b/PodCode/Classes/CRBoxInputView.h index ec420d2..9e0a2c7 100755 --- a/PodCode/Classes/CRBoxInputView.h +++ b/PodCode/Classes/CRBoxInputView.h @@ -29,6 +29,7 @@ typedef NS_ENUM(NSInteger, CRInputType) { typedef void(^TextDidChangeblock)(NSString * _Nullable text, BOOL isFinished); typedef void(^TextEditStatusChangeblock)(CRTextEditStatus editStatus); +typedef NSString *(^TextCustomProcessblock)(NSString * _Nullable text); @interface CRBoxInputView : UIView @@ -110,6 +111,8 @@ default: @"" @property (copy, nonatomic) TextDidChangeblock _Nullable textDidChangeblock; @property (copy, nonatomic) TextEditStatusChangeblock _Nullable textEditStatusChangeblock; +/// 文本自定义处理 +@property (copy, nonatomic) TextCustomProcessblock _Nullable textCustomProcessblock; @property (strong, nonatomic) CRBoxFlowLayout * _Nullable boxFlowLayout; @property (strong, nonatomic) CRBoxInputCellProperty * _Nullable customCellProperty; @property (strong, nonatomic, readonly) NSString * _Nullable textValue; diff --git a/PodCode/Classes/CRBoxInputView.m b/PodCode/Classes/CRBoxInputView.m index 03747be..3e83eba 100755 --- a/PodCode/Classes/CRBoxInputView.m +++ b/PodCode/Classes/CRBoxInputView.m @@ -301,6 +301,11 @@ - (void)baseTextDidChange:(UITextField *)textField manualInvoke:(BOOL)manualInvo verStr = [verStr stringByReplacingOccurrencesOfString:@" " withString:@""]; verStr = [self filterInputContent:verStr]; + //自定义处理 + if (self.textCustomProcessblock) { + verStr = self.textCustomProcessblock(verStr); + } + if (verStr.length >= _codeLength) { verStr = [verStr substringToIndex:_codeLength]; [self endEdit]; diff --git a/README.md b/README.md index b8acfa1..a825153 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ boxInputView.customCellProperty = cellProperty; ### ResetCodeLength +![ResetCodeLength.png](/ReadmeResources/2ResetCodeLength.gif "ResetCodeLength.png") ``` objc [boxInputView resetCodeLength:_boxInputView.codeLength+1 beginEdit:YES]; ``` diff --git a/README_en.md b/README_en.md index e752fcc..d4da595 100644 --- a/README_en.md +++ b/README_en.md @@ -241,6 +241,7 @@ boxInputView.customCellProperty = cellProperty; ### ResetCodeLength +![ResetCodeLength.png](/ReadmeResources/2ResetCodeLength.gif "ResetCodeLength.png") ``` objc [boxInputView resetCodeLength:_boxInputView.codeLength+1 beginEdit:YES]; ```