├── .gitignore ├── JhtVerificationCodeBox.podspec ├── JhtVerificationCodeBox_SDK └── JhtVerificationCodeView.framework │ ├── Headers │ └── JhtVerificationCodeView.h │ ├── Info.plist │ ├── JhtVerificationCodeView │ └── Modules │ └── module.modulemap ├── LICENSE ├── README.md ├── ReadMEImages └── Gif │ └── VerificationCodeView.gif ├── VerificationCodeBox.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── Jht.xcuserdatad │ └── xcschemes │ ├── VerificationCodeBox.xcscheme │ └── xcschememanagement.plist └── VerificationCodeBox ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets └── AppIcon.appiconset │ ├── Contents.json │ ├── ios-template-120.png │ ├── ios-template-121.png │ ├── ios-template-180.png │ ├── ios-template-40.png │ ├── ios-template-58.png │ ├── ios-template-80.png │ └── ios-template-87.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build 4 | /*.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | !default.xcworkspace 13 | xcuserdata 14 | *.moved-aside 15 | *.mobileprovision 16 | DerivedData 17 | .idea/ 18 | # Pods - for those of you who use CocoaPods 19 | Pods 20 | Podfile.lock 21 | Podfile 22 | *.xcworkspace 23 | 24 | -------------------------------------------------------------------------------- /JhtVerificationCodeBox.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'JhtVerificationCodeBox' 4 | s.version = '1.0.4' 5 | s.summary = '验证码 && 密码 校验View' 6 | s.homepage = 'https://github.com/jinht/VerificationCodeBox' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.author = { 'Jinht' => 'jinjob@icloud.com' } 9 | s.social_media_url = 'https://blog.csdn.net/Anticipate91' 10 | s.platform = :ios 11 | s.ios.deployment_target = '8.0' 12 | s.source = { :git => 'https://github.com/jinht/VerificationCodeBox.git', :tag => s.version } 13 | s.ios.vendored_frameworks = 'JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework' 14 | s.frameworks = 'UIKit' 15 | 16 | end 17 | -------------------------------------------------------------------------------- /JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/Headers/JhtVerificationCodeView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtVerificationCodeView.h 3 | // JhtTools 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/7/13. 9 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 展示 类型 */ 15 | typedef NS_ENUM(NSUInteger, JhtVerificationCodeViewType) { 16 | // normal type 17 | VerificationCodeViewType_Normal, 18 | // secret type 19 | VerificationCodeViewType_Secret 20 | }; 21 | 22 | 23 | /** 输入验证码 满位后 发送的 通知名 */ 24 | extern const NSString *Jht_InputFull_NotiKey; 25 | 26 | /** 验证码校验框 */ 27 | @interface JhtVerificationCodeView : UIView 28 | 29 | #pragma mark - property 30 | #pragma mark required 31 | /** 回调 输入的验证码 */ 32 | @property (nonatomic, copy) void(^editBlcok)(NSString *text); 33 | 34 | #pragma mark optional 35 | /** 展示 类型 36 | * default: VerificationCodeViewType_Custom 37 | */ 38 | @property (nonatomic, assign) JhtVerificationCodeViewType codeViewType; 39 | 40 | /** 是否需要边框(每个格子的框) 41 | * default: NO 42 | */ 43 | @property (nonatomic, assign) BOOL hasBoder; 44 | /** 边框颜色(hasBoder = YES) 45 | * default: [UIColor grayColor] 46 | */ 47 | @property (nonatomic, strong) UIColor *boderColor; 48 | 49 | /** 验证码总数 50 | * default: 6 51 | */ 52 | @property (nonatomic, assign) NSInteger total; 53 | 54 | /** 文字颜色 55 | * default: [UIColor blackColor] 56 | */ 57 | @property (nonatomic, strong) UIColor *textColor; 58 | /** 文字UIFont 59 | * default: [UIFont boldSystemFontOfSize:17] 60 | */ 61 | @property (nonatomic, strong) UIFont *textFont; 62 | 63 | /** 是否需要占位符下划线 64 | * default: NO 65 | */ 66 | @property (nonatomic, assign) BOOL hasUnderLine; 67 | /** 占位符下划线颜色(hasUnderLine = YES) 68 | * default: [UIColor grayColor] 69 | */ 70 | @property (nonatomic, strong) UIColor *underLineColor; 71 | 72 | /** 未输入状态下占位符下划线是否闪烁 73 | * default: NO 74 | */ 75 | @property (nonatomic, assign) BOOL isFlashing_NoInput; 76 | 77 | /** 是否需要输入位数满后清空 78 | * default: NO 79 | */ 80 | @property (nonatomic, assign) BOOL isClearWhenInputFull; 81 | 82 | /** 下划线 动画时间 83 | * default: 0.6 84 | */ 85 | @property (nonatomic, assign) CGFloat underLineAnimationDuration; 86 | 87 | 88 | #pragma mark - Public Method 89 | /** becomeFirstResponder */ 90 | - (void)Jht_BecomeFirstResponder; 91 | /** resignFirstResponder */ 92 | - (void)Jht_ResignFirstResponder; 93 | 94 | /** 改变所有已输入验证码的颜色(通常在输入验证码错误的情况下用到) 95 | * color: 要改变的颜色 96 | * hasShakeAndClear: 是否需要抖动 && 清空 97 | */ 98 | - (void)changeAllAlreadyInputTextColor:(UIColor *)color hasShakeAndClear:(BOOL)hasShakeAndClear; 99 | 100 | /** update keyBoard type 101 | * 不建议使用非 UIKeyboardTypeNumberPad 102 | */ 103 | - (void)updateKeyBoardType:(UIKeyboardType)type; 104 | 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/Info.plist -------------------------------------------------------------------------------- /JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/JhtVerificationCodeView: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/JhtVerificationCodeView -------------------------------------------------------------------------------- /JhtVerificationCodeBox_SDK/JhtVerificationCodeView.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module JhtVerificationCodeView { 2 | umbrella header "JhtVerificationCodeView.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 jinht 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## JhtVerificationCodeBox 2 | 3 | 4 | ### 先上图,看一下是否符合你的场景吧! 5 | 6 | 7 | 8 | ### Function Description 9 | 1. 密文 || 明文输入 10 | 2. 变色 || 抖动清空 11 | 3. 呼吸闪烁占位符下划线 12 | 13 | 14 | ### how to use 15 | ### 1. podfile 16 | ```oc 17 | platform:ios, '8.0' 18 | 19 | target 'VerificationCodeBox' do 20 | 21 | pod 'JhtVerificationCodeBox' 22 | 23 | end 24 | ``` 25 | 26 | 27 | 28 | #### 2. 简单的初始化:快速集成做这些就够了 29 | ```oc 30 | JhtVerificationCodeView *verificationCodeView = [[JhtVerificationCodeView alloc] initWithFrame:CGRectMake(40, 20 + 40 + 100 * i, CGRectGetWidth(self.view.frame) - 80, 60)]; 31 | verificationCodeView.endEditBlcok = ^(NSString *text) { 32 | NSLog(@"输入的验证码为:%@", text); 33 | }; 34 | ``` 35 | 36 | 37 | #### 3. 选配项 :根据需求做相关property的配置 38 | ```oc 39 | #pragma mark optional 40 | /** 展示 类型 41 | * default:VerificationCodeViewType_Custom 42 | */ 43 | @property (nonatomic, assign) JhtVerificationCodeViewType codeViewType; 44 | 45 | /** 是否需要边框(每个格子的框) 46 | * default:NO 47 | */ 48 | @property (nonatomic, assign) BOOL hasBoder; 49 | /** 边框颜色(hasBoder = YES) 50 | *  default:[UIColor grayColor] 51 | */ 52 | @property (nonatomic, strong) UIColor *boderColor; 53 | 54 | /** 验证码总数 55 | * default:6 56 | */ 57 | @property (nonatomic, assign) NSInteger total; 58 | 59 | /** 文字颜色 60 | *  default:[UIColor blackColor] 61 | */ 62 | @property (nonatomic, strong) UIColor *textColor; 63 | /** 文字UIFont 64 | *  default:[UIFont boldSystemFontOfSize:17] 65 | */ 66 | @property (nonatomic, strong) UIFont *textFont; 67 | 68 | /** 是否需要占位符下划线 69 | * default:NO 70 | */ 71 | @property (nonatomic, assign) BOOL hasUnderLine; 72 | /** 占位符下划线颜色(hasUnderLine = YES) 73 | * default:[UIColor grayColor] 74 | */ 75 | @property (nonatomic, strong) UIColor *underLineColor; 76 | 77 | /** 未输入状态下占位符下划线是否闪烁 78 | * default:NO 79 | */ 80 | @property (nonatomic, assign) BOOL isFlashing_NoInput; 81 | 82 | /** 是否需要输入位数满后清空 83 | *  default:NO 84 | */ 85 | @property (nonatomic, assign) BOOL isClearWhenInputFull; 86 | ``` 87 | 88 | 89 | #### 4. 常用方法说明 90 | ```oc 91 | /** 改变所有已输入验证码的颜色(通常在输入验证码错误的情况下用到) 92 | * scenes:验证码输入有误变色 93 | * hasShakeAndClear:是否需要抖动 && 清空 94 | */ 95 | - (void)changeAllAlreadyInputTextColorWithColor:(UIColor *)color hasShakeAndClear:(BOOL)hasShakeAndClear; 96 | 97 | // 变色 && 震动 && 清空 98 | [verificationCodeView changeAllAlreadyInputTextColorWithColor:col hasShakeAndClear:YES]; 99 | ``` 100 | 101 | * 具体使用详见demo(使用demo之前请先 **pod install** ) 102 | 103 | 104 | ### Remind 105 | * ARC 106 | * iOS >= 8.0 107 | * iPhone \ iPad 108 | 109 | 110 | ## Hope 111 | * If you find bug when used,Hope you can Issues me,Thank you or try to download the latest code of this framework to see the BUG has been fixed or not 112 | * If you find the function is not enough when used,Hope you can Issues me,I very much to add more useful function to this framework ,Thank you ! 113 | -------------------------------------------------------------------------------- /ReadMEImages/Gif/VerificationCodeView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/ReadMEImages/Gif/VerificationCodeView.gif -------------------------------------------------------------------------------- /VerificationCodeBox.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8EC6891C21C7423800B4AB3D /* JhtVerificationCodeView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EC6891B21C7423800B4AB3D /* JhtVerificationCodeView.framework */; }; 11 | A52B93921F1F284400DBDE3C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A52B93911F1F284400DBDE3C /* main.m */; }; 12 | A52B93951F1F284400DBDE3C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A52B93941F1F284400DBDE3C /* AppDelegate.m */; }; 13 | A52B93981F1F284400DBDE3C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A52B93971F1F284400DBDE3C /* ViewController.m */; }; 14 | A52B939B1F1F284400DBDE3C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52B93991F1F284400DBDE3C /* Main.storyboard */; }; 15 | A52B939D1F1F284400DBDE3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A52B939C1F1F284400DBDE3C /* Assets.xcassets */; }; 16 | A52B93A01F1F284400DBDE3C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52B939E1F1F284400DBDE3C /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | A52B93A71F1F284500DBDE3C /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = A52B93851F1F284400DBDE3C /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = A52B938C1F1F284400DBDE3C; 25 | remoteInfo = VerificationCodeBox; 26 | }; 27 | A52B93B21F1F284500DBDE3C /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = A52B93851F1F284400DBDE3C /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = A52B938C1F1F284400DBDE3C; 32 | remoteInfo = VerificationCodeBox; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 8EC6891B21C7423800B4AB3D /* JhtVerificationCodeView.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JhtVerificationCodeView.framework; sourceTree = ""; }; 38 | A52B938D1F1F284400DBDE3C /* VerificationCodeBox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VerificationCodeBox.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | A52B93911F1F284400DBDE3C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | A52B93931F1F284400DBDE3C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | A52B93941F1F284400DBDE3C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | A52B93961F1F284400DBDE3C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 43 | A52B93971F1F284400DBDE3C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 44 | A52B939A1F1F284400DBDE3C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | A52B939C1F1F284400DBDE3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | A52B939F1F1F284400DBDE3C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | A52B93A11F1F284400DBDE3C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | A52B93A61F1F284500DBDE3C /* VerificationCodeBoxTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VerificationCodeBoxTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | A52B93B11F1F284500DBDE3C /* VerificationCodeBoxUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VerificationCodeBoxUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | A52B938A1F1F284400DBDE3C /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 8EC6891C21C7423800B4AB3D /* JhtVerificationCodeView.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | A52B93A31F1F284500DBDE3C /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | A52B93AE1F1F284500DBDE3C /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 8EC6891A21C7423800B4AB3D /* JhtVerificationCodeBox_SDK */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 8EC6891B21C7423800B4AB3D /* JhtVerificationCodeView.framework */, 82 | ); 83 | path = JhtVerificationCodeBox_SDK; 84 | sourceTree = ""; 85 | }; 86 | A52B93841F1F284400DBDE3C = { 87 | isa = PBXGroup; 88 | children = ( 89 | 8EC6891A21C7423800B4AB3D /* JhtVerificationCodeBox_SDK */, 90 | A52B938F1F1F284400DBDE3C /* VerificationCodeBox */, 91 | A52B938E1F1F284400DBDE3C /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | A52B938E1F1F284400DBDE3C /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | A52B938D1F1F284400DBDE3C /* VerificationCodeBox.app */, 99 | A52B93A61F1F284500DBDE3C /* VerificationCodeBoxTests.xctest */, 100 | A52B93B11F1F284500DBDE3C /* VerificationCodeBoxUITests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | A52B938F1F1F284400DBDE3C /* VerificationCodeBox */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | A52B93931F1F284400DBDE3C /* AppDelegate.h */, 109 | A52B93941F1F284400DBDE3C /* AppDelegate.m */, 110 | A52B93961F1F284400DBDE3C /* ViewController.h */, 111 | A52B93971F1F284400DBDE3C /* ViewController.m */, 112 | A52B93991F1F284400DBDE3C /* Main.storyboard */, 113 | A52B939C1F1F284400DBDE3C /* Assets.xcassets */, 114 | A52B939E1F1F284400DBDE3C /* LaunchScreen.storyboard */, 115 | A52B93A11F1F284400DBDE3C /* Info.plist */, 116 | A52B93901F1F284400DBDE3C /* Supporting Files */, 117 | ); 118 | path = VerificationCodeBox; 119 | sourceTree = ""; 120 | }; 121 | A52B93901F1F284400DBDE3C /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | A52B93911F1F284400DBDE3C /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | A52B938C1F1F284400DBDE3C /* VerificationCodeBox */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = A52B93BA1F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBox" */; 135 | buildPhases = ( 136 | A52B93891F1F284400DBDE3C /* Sources */, 137 | A52B938A1F1F284400DBDE3C /* Frameworks */, 138 | A52B938B1F1F284400DBDE3C /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = VerificationCodeBox; 145 | productName = VerificationCodeBox; 146 | productReference = A52B938D1F1F284400DBDE3C /* VerificationCodeBox.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | A52B93A51F1F284500DBDE3C /* VerificationCodeBoxTests */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = A52B93BD1F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBoxTests" */; 152 | buildPhases = ( 153 | A52B93A21F1F284500DBDE3C /* Sources */, 154 | A52B93A31F1F284500DBDE3C /* Frameworks */, 155 | A52B93A41F1F284500DBDE3C /* Resources */, 156 | ); 157 | buildRules = ( 158 | ); 159 | dependencies = ( 160 | A52B93A81F1F284500DBDE3C /* PBXTargetDependency */, 161 | ); 162 | name = VerificationCodeBoxTests; 163 | productName = VerificationCodeBoxTests; 164 | productReference = A52B93A61F1F284500DBDE3C /* VerificationCodeBoxTests.xctest */; 165 | productType = "com.apple.product-type.bundle.unit-test"; 166 | }; 167 | A52B93B01F1F284500DBDE3C /* VerificationCodeBoxUITests */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = A52B93C01F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBoxUITests" */; 170 | buildPhases = ( 171 | A52B93AD1F1F284500DBDE3C /* Sources */, 172 | A52B93AE1F1F284500DBDE3C /* Frameworks */, 173 | A52B93AF1F1F284500DBDE3C /* Resources */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | A52B93B31F1F284500DBDE3C /* PBXTargetDependency */, 179 | ); 180 | name = VerificationCodeBoxUITests; 181 | productName = VerificationCodeBoxUITests; 182 | productReference = A52B93B11F1F284500DBDE3C /* VerificationCodeBoxUITests.xctest */; 183 | productType = "com.apple.product-type.bundle.ui-testing"; 184 | }; 185 | /* End PBXNativeTarget section */ 186 | 187 | /* Begin PBXProject section */ 188 | A52B93851F1F284400DBDE3C /* Project object */ = { 189 | isa = PBXProject; 190 | attributes = { 191 | LastUpgradeCheck = 0830; 192 | ORGANIZATIONNAME = Jinht; 193 | TargetAttributes = { 194 | A52B938C1F1F284400DBDE3C = { 195 | CreatedOnToolsVersion = 8.3.2; 196 | DevelopmentTeam = Q67TW3T8PL; 197 | ProvisioningStyle = Automatic; 198 | }; 199 | A52B93A51F1F284500DBDE3C = { 200 | CreatedOnToolsVersion = 8.3.2; 201 | DevelopmentTeam = BY48QUJK83; 202 | ProvisioningStyle = Automatic; 203 | TestTargetID = A52B938C1F1F284400DBDE3C; 204 | }; 205 | A52B93B01F1F284500DBDE3C = { 206 | CreatedOnToolsVersion = 8.3.2; 207 | DevelopmentTeam = BY48QUJK83; 208 | ProvisioningStyle = Automatic; 209 | TestTargetID = A52B938C1F1F284400DBDE3C; 210 | }; 211 | }; 212 | }; 213 | buildConfigurationList = A52B93881F1F284400DBDE3C /* Build configuration list for PBXProject "VerificationCodeBox" */; 214 | compatibilityVersion = "Xcode 3.2"; 215 | developmentRegion = English; 216 | hasScannedForEncodings = 0; 217 | knownRegions = ( 218 | English, 219 | en, 220 | Base, 221 | ); 222 | mainGroup = A52B93841F1F284400DBDE3C; 223 | productRefGroup = A52B938E1F1F284400DBDE3C /* Products */; 224 | projectDirPath = ""; 225 | projectRoot = ""; 226 | targets = ( 227 | A52B938C1F1F284400DBDE3C /* VerificationCodeBox */, 228 | A52B93A51F1F284500DBDE3C /* VerificationCodeBoxTests */, 229 | A52B93B01F1F284500DBDE3C /* VerificationCodeBoxUITests */, 230 | ); 231 | }; 232 | /* End PBXProject section */ 233 | 234 | /* Begin PBXResourcesBuildPhase section */ 235 | A52B938B1F1F284400DBDE3C /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | A52B93A01F1F284400DBDE3C /* LaunchScreen.storyboard in Resources */, 240 | A52B939D1F1F284400DBDE3C /* Assets.xcassets in Resources */, 241 | A52B939B1F1F284400DBDE3C /* Main.storyboard in Resources */, 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | A52B93A41F1F284500DBDE3C /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | A52B93AF1F1F284500DBDE3C /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | /* End PBXResourcesBuildPhase section */ 260 | 261 | /* Begin PBXSourcesBuildPhase section */ 262 | A52B93891F1F284400DBDE3C /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | A52B93981F1F284400DBDE3C /* ViewController.m in Sources */, 267 | A52B93951F1F284400DBDE3C /* AppDelegate.m in Sources */, 268 | A52B93921F1F284400DBDE3C /* main.m in Sources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | A52B93A21F1F284500DBDE3C /* Sources */ = { 273 | isa = PBXSourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | A52B93AD1F1F284500DBDE3C /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXSourcesBuildPhase section */ 287 | 288 | /* Begin PBXTargetDependency section */ 289 | A52B93A81F1F284500DBDE3C /* PBXTargetDependency */ = { 290 | isa = PBXTargetDependency; 291 | target = A52B938C1F1F284400DBDE3C /* VerificationCodeBox */; 292 | targetProxy = A52B93A71F1F284500DBDE3C /* PBXContainerItemProxy */; 293 | }; 294 | A52B93B31F1F284500DBDE3C /* PBXTargetDependency */ = { 295 | isa = PBXTargetDependency; 296 | target = A52B938C1F1F284400DBDE3C /* VerificationCodeBox */; 297 | targetProxy = A52B93B21F1F284500DBDE3C /* PBXContainerItemProxy */; 298 | }; 299 | /* End PBXTargetDependency section */ 300 | 301 | /* Begin PBXVariantGroup section */ 302 | A52B93991F1F284400DBDE3C /* Main.storyboard */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | A52B939A1F1F284400DBDE3C /* Base */, 306 | ); 307 | name = Main.storyboard; 308 | sourceTree = ""; 309 | }; 310 | A52B939E1F1F284400DBDE3C /* LaunchScreen.storyboard */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | A52B939F1F1F284400DBDE3C /* Base */, 314 | ); 315 | name = LaunchScreen.storyboard; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXVariantGroup section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | A52B93B81F1F284500DBDE3C /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 340 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 341 | CLANG_WARN_UNREACHABLE_CODE = YES; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 344 | COPY_PHASE_STRIP = NO; 345 | DEBUG_INFORMATION_FORMAT = dwarf; 346 | ENABLE_STRICT_OBJC_MSGSEND = YES; 347 | ENABLE_TESTABILITY = YES; 348 | GCC_C_LANGUAGE_STANDARD = gnu99; 349 | GCC_DYNAMIC_NO_PIC = NO; 350 | GCC_NO_COMMON_BLOCKS = YES; 351 | GCC_OPTIMIZATION_LEVEL = 0; 352 | GCC_PREPROCESSOR_DEFINITIONS = ( 353 | "DEBUG=1", 354 | "$(inherited)", 355 | ); 356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 358 | GCC_WARN_UNDECLARED_SELECTOR = YES; 359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 360 | GCC_WARN_UNUSED_FUNCTION = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 363 | MTL_ENABLE_DEBUG_INFO = YES; 364 | ONLY_ACTIVE_ARCH = YES; 365 | SDKROOT = iphoneos; 366 | }; 367 | name = Debug; 368 | }; 369 | A52B93B91F1F284500DBDE3C /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_SEARCH_USER_PATHS = NO; 373 | CLANG_ANALYZER_NONNULL = YES; 374 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 375 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 376 | CLANG_CXX_LIBRARY = "libc++"; 377 | CLANG_ENABLE_MODULES = YES; 378 | CLANG_ENABLE_OBJC_ARC = YES; 379 | CLANG_WARN_BOOL_CONVERSION = YES; 380 | CLANG_WARN_CONSTANT_CONVERSION = YES; 381 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 382 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 383 | CLANG_WARN_EMPTY_BODY = YES; 384 | CLANG_WARN_ENUM_CONVERSION = YES; 385 | CLANG_WARN_INFINITE_RECURSION = YES; 386 | CLANG_WARN_INT_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 389 | CLANG_WARN_UNREACHABLE_CODE = YES; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 392 | COPY_PHASE_STRIP = NO; 393 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 394 | ENABLE_NS_ASSERTIONS = NO; 395 | ENABLE_STRICT_OBJC_MSGSEND = YES; 396 | GCC_C_LANGUAGE_STANDARD = gnu99; 397 | GCC_NO_COMMON_BLOCKS = YES; 398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 400 | GCC_WARN_UNDECLARED_SELECTOR = YES; 401 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 402 | GCC_WARN_UNUSED_FUNCTION = YES; 403 | GCC_WARN_UNUSED_VARIABLE = YES; 404 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 405 | MTL_ENABLE_DEBUG_INFO = NO; 406 | SDKROOT = iphoneos; 407 | VALIDATE_PRODUCT = YES; 408 | }; 409 | name = Release; 410 | }; 411 | A52B93BB1F1F284500DBDE3C /* Debug */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 415 | DEVELOPMENT_TEAM = Q67TW3T8PL; 416 | FRAMEWORK_SEARCH_PATHS = ( 417 | "$(inherited)", 418 | "$(PROJECT_DIR)", 419 | "$(PROJECT_DIR)/JhtVerificationCodeBox_SDK", 420 | ); 421 | HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/JhtVerificationCodeView.framework/Headers"; 422 | INFOPLIST_FILE = VerificationCodeBox/Info.plist; 423 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 425 | LIBRARY_SEARCH_PATHS = ( 426 | "$(inherited)", 427 | "$(PROJECT_DIR)/JhtVerificationCodeView.framework", 428 | ); 429 | PRODUCT_BUNDLE_IDENTIFIER = com.VerificationCodeBox; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | }; 432 | name = Debug; 433 | }; 434 | A52B93BC1F1F284500DBDE3C /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | DEVELOPMENT_TEAM = Q67TW3T8PL; 439 | FRAMEWORK_SEARCH_PATHS = ( 440 | "$(inherited)", 441 | "$(PROJECT_DIR)", 442 | "$(PROJECT_DIR)/JhtVerificationCodeBox_SDK", 443 | ); 444 | HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/JhtVerificationCodeView.framework/Headers"; 445 | INFOPLIST_FILE = VerificationCodeBox/Info.plist; 446 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 448 | LIBRARY_SEARCH_PATHS = ( 449 | "$(inherited)", 450 | "$(PROJECT_DIR)/JhtVerificationCodeView.framework", 451 | ); 452 | PRODUCT_BUNDLE_IDENTIFIER = com.VerificationCodeBox; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | }; 455 | name = Release; 456 | }; 457 | A52B93BE1F1F284500DBDE3C /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | BUNDLE_LOADER = "$(TEST_HOST)"; 461 | DEVELOPMENT_TEAM = BY48QUJK83; 462 | INFOPLIST_FILE = VerificationCodeBoxTests/Info.plist; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = com.souyidai.FoxAppNew.VerificationCodeBoxTests; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VerificationCodeBox.app/VerificationCodeBox"; 467 | }; 468 | name = Debug; 469 | }; 470 | A52B93BF1F1F284500DBDE3C /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | BUNDLE_LOADER = "$(TEST_HOST)"; 474 | DEVELOPMENT_TEAM = BY48QUJK83; 475 | INFOPLIST_FILE = VerificationCodeBoxTests/Info.plist; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = com.souyidai.FoxAppNew.VerificationCodeBoxTests; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VerificationCodeBox.app/VerificationCodeBox"; 480 | }; 481 | name = Release; 482 | }; 483 | A52B93C11F1F284500DBDE3C /* Debug */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | DEVELOPMENT_TEAM = BY48QUJK83; 487 | INFOPLIST_FILE = VerificationCodeBoxUITests/Info.plist; 488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 489 | PRODUCT_BUNDLE_IDENTIFIER = com.souyidai.FoxAppNew.VerificationCodeBoxUITests; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | TEST_TARGET_NAME = VerificationCodeBox; 492 | }; 493 | name = Debug; 494 | }; 495 | A52B93C21F1F284500DBDE3C /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | DEVELOPMENT_TEAM = BY48QUJK83; 499 | INFOPLIST_FILE = VerificationCodeBoxUITests/Info.plist; 500 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 501 | PRODUCT_BUNDLE_IDENTIFIER = com.souyidai.FoxAppNew.VerificationCodeBoxUITests; 502 | PRODUCT_NAME = "$(TARGET_NAME)"; 503 | TEST_TARGET_NAME = VerificationCodeBox; 504 | }; 505 | name = Release; 506 | }; 507 | /* End XCBuildConfiguration section */ 508 | 509 | /* Begin XCConfigurationList section */ 510 | A52B93881F1F284400DBDE3C /* Build configuration list for PBXProject "VerificationCodeBox" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | A52B93B81F1F284500DBDE3C /* Debug */, 514 | A52B93B91F1F284500DBDE3C /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | A52B93BA1F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBox" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | A52B93BB1F1F284500DBDE3C /* Debug */, 523 | A52B93BC1F1F284500DBDE3C /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | A52B93BD1F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBoxTests" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | A52B93BE1F1F284500DBDE3C /* Debug */, 532 | A52B93BF1F1F284500DBDE3C /* Release */, 533 | ); 534 | defaultConfigurationIsVisible = 0; 535 | defaultConfigurationName = Release; 536 | }; 537 | A52B93C01F1F284500DBDE3C /* Build configuration list for PBXNativeTarget "VerificationCodeBoxUITests" */ = { 538 | isa = XCConfigurationList; 539 | buildConfigurations = ( 540 | A52B93C11F1F284500DBDE3C /* Debug */, 541 | A52B93C21F1F284500DBDE3C /* Release */, 542 | ); 543 | defaultConfigurationIsVisible = 0; 544 | defaultConfigurationName = Release; 545 | }; 546 | /* End XCConfigurationList section */ 547 | }; 548 | rootObject = A52B93851F1F284400DBDE3C /* Project object */; 549 | } 550 | -------------------------------------------------------------------------------- /VerificationCodeBox.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VerificationCodeBox.xcodeproj/xcuserdata/Jht.xcuserdatad/xcschemes/VerificationCodeBox.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /VerificationCodeBox.xcodeproj/xcuserdata/Jht.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | VerificationCodeBox.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A52B938C1F1F284400DBDE3C 16 | 17 | primary 18 | 19 | 20 | A52B93A51F1F284500DBDE3C 21 | 22 | primary 23 | 24 | 25 | A52B93B01F1F284500DBDE3C 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /VerificationCodeBox/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // VerificationCodeBox 4 | // 5 | // Created by Jht on 2017/7/19. 6 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /VerificationCodeBox/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // VerificationCodeBox 4 | // 5 | // Created by Jht on 2017/7/19. 6 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "ios-template-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "idiom" : "iphone", 11 | "size" : "20x20", 12 | "scale" : "3x" 13 | }, 14 | { 15 | "size" : "29x29", 16 | "idiom" : "iphone", 17 | "filename" : "ios-template-58.png", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "size" : "29x29", 22 | "idiom" : "iphone", 23 | "filename" : "ios-template-87.png", 24 | "scale" : "3x" 25 | }, 26 | { 27 | "size" : "40x40", 28 | "idiom" : "iphone", 29 | "filename" : "ios-template-80.png", 30 | "scale" : "2x" 31 | }, 32 | { 33 | "size" : "40x40", 34 | "idiom" : "iphone", 35 | "filename" : "ios-template-120.png", 36 | "scale" : "3x" 37 | }, 38 | { 39 | "size" : "60x60", 40 | "idiom" : "iphone", 41 | "filename" : "ios-template-121.png", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "size" : "60x60", 46 | "idiom" : "iphone", 47 | "filename" : "ios-template-180.png", 48 | "scale" : "3x" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-120.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-121.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-180.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-40.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-58.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-80.png -------------------------------------------------------------------------------- /VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/VerificationCodeBox/b7b7860157445956753ab2265078415e48d5b512/VerificationCodeBox/Assets.xcassets/AppIcon.appiconset/ios-template-87.png -------------------------------------------------------------------------------- /VerificationCodeBox/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /VerificationCodeBox/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /VerificationCodeBox/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /VerificationCodeBox/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // VerificationCodeBox 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/7/19. 9 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | @interface ViewController : UIViewController 15 | 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /VerificationCodeBox/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // VerificationCodeBox 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/7/19. 9 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 10 | // 11 | 12 | #import "ViewController.h" 13 | #import 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor whiteColor]; 20 | 21 | [self createUI]; 22 | } 23 | 24 | 25 | #pragma mark - UI 26 | - (void)createUI { 27 | for (NSInteger i = 0; i < 2; i ++) { 28 | JhtVerificationCodeView *verificationCodeView = [[JhtVerificationCodeView alloc] initWithFrame:CGRectMake(40, 20 + 60 + 100 * i, CGRectGetWidth(self.view.frame) - 80, 60)]; 29 | verificationCodeView.tag = 100 + i; 30 | 31 | switch (i) { 32 | case 0: { 33 | // 边框(每个格子的框) 34 | verificationCodeView.hasBoder = YES; 35 | verificationCodeView.boderColor = [UIColor redColor]; 36 | // 展示 类型 37 | verificationCodeView.codeViewType = VerificationCodeViewType_Secret; 38 | 39 | break; 40 | } 41 | 42 | case 1: { 43 | // 下划线 44 | verificationCodeView.hasUnderLine = YES; 45 | verificationCodeView.underLineColor = [UIColor greenColor]; 46 | verificationCodeView.isFlashing_NoInput = YES; 47 | // 展示 类型 48 | verificationCodeView.codeViewType = VerificationCodeViewType_Normal; 49 | 50 | break; 51 | } 52 | 53 | default: 54 | break; 55 | } 56 | 57 | // verificationCodeView.backgroundColor = [UIColor redColor]; 58 | verificationCodeView.editBlcok = ^(NSString *text) { 59 | NSLog(@"输入的验证码为:%@", text); 60 | }; 61 | 62 | [self.view addSubview:verificationCodeView]; 63 | 64 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame) - 170 - 10, CGRectGetMaxY(verificationCodeView.frame) + 5, 170, 30)]; 65 | btn.tag = 200 + i; 66 | btn.titleLabel.font = [UIFont systemFontOfSize:12]; 67 | [btn setBackgroundColor:[UIColor purpleColor]]; 68 | [btn setTitle:@"改变所有已输入验证码的颜色" forState:UIControlStateNormal]; 69 | [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; 70 | btn.layer.cornerRadius = 5; 71 | [self.view addSubview:btn]; 72 | 73 | if (i == 1) { 74 | [verificationCodeView Jht_BecomeFirstResponder]; 75 | } 76 | } 77 | } 78 | 79 | /** 点击@"改变所有已输入验证码的颜色"按钮触发方法 */ 80 | - (void)btnClick:(UIButton *)btn { 81 | JhtVerificationCodeView *view = [self.view viewWithTag:btn.tag - 100]; 82 | UIColor *col = [UIColor orangeColor];; 83 | if (btn.tag % 2 == 0) { 84 | // 变色 && 震动 && 清空 85 | [view changeAllAlreadyInputTextColor:col hasShakeAndClear:YES]; 86 | } else { 87 | // 变色 88 | [view changeAllAlreadyInputTextColor:col hasShakeAndClear:NO]; 89 | } 90 | } 91 | 92 | 93 | #pragma mark - UIResponder 94 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 95 | CGPoint point = [[touches anyObject] locationInView:self.view]; 96 | BOOL isEndEdit = NO; 97 | 98 | for (NSInteger i = 100; i < 102; i ++) { 99 | UIView *view = [self.view viewWithTag:i]; 100 | CGPoint point2 = [view convertPoint:point fromView:self.view]; 101 | 102 | if ([view.layer containsPoint:point2]) { 103 | isEndEdit = YES; 104 | } 105 | } 106 | 107 | if (!isEndEdit) { 108 | [self.view endEditing:YES]; 109 | } 110 | } 111 | 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /VerificationCodeBox/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // VerificationCodeBox 4 | // 5 | // Created by Jht on 2017/7/19. 6 | // Copyright © 2017年 VerificationCodeView. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | --------------------------------------------------------------------------------