├── DeleTextField.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── mini.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── yangmin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── mini.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ └── yangmin.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── DeleTextField ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── TaxInputView.swift ├── ViewController.swift ├── YMYCodeTextField.swift └── YMYCodeView.swift └── README.md /DeleTextField.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D2AAF6F20B6646A00A907DC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AAF6E20B6646A00A907DC /* AppDelegate.swift */; }; 11 | 3D2AAF7120B6646A00A907DC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AAF7020B6646A00A907DC /* ViewController.swift */; }; 12 | 3D2AAF7420B6646A00A907DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AAF7220B6646A00A907DC /* Main.storyboard */; }; 13 | 3D2AAF7620B6646A00A907DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AAF7520B6646A00A907DC /* Assets.xcassets */; }; 14 | 3D2AAF7920B6646A00A907DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AAF7720B6646A00A907DC /* LaunchScreen.storyboard */; }; 15 | 3D2AAF8120B6649400A907DC /* YMYCodeTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AAF8020B6649400A907DC /* YMYCodeTextField.swift */; }; 16 | 3D2AAF8320B66B0900A907DC /* YMYCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AAF8220B66B0900A907DC /* YMYCodeView.swift */; }; 17 | 3DEBB8B5217887130065207D /* TaxInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DEBB8B4217887130065207D /* TaxInputView.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 3D2AAF6B20B6646A00A907DC /* DeleTextField.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DeleTextField.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 3D2AAF6E20B6646A00A907DC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | 3D2AAF7020B6646A00A907DC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 24 | 3D2AAF7320B6646A00A907DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | 3D2AAF7520B6646A00A907DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | 3D2AAF7820B6646A00A907DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | 3D2AAF7A20B6646A00A907DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 3D2AAF8020B6649400A907DC /* YMYCodeTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YMYCodeTextField.swift; sourceTree = ""; }; 29 | 3D2AAF8220B66B0900A907DC /* YMYCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YMYCodeView.swift; sourceTree = ""; }; 30 | 3DEBB8B4217887130065207D /* TaxInputView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaxInputView.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 3D2AAF6820B6646A00A907DC /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 3D2AAF6220B6646A00A907DC = { 45 | isa = PBXGroup; 46 | children = ( 47 | 3D2AAF6D20B6646A00A907DC /* DeleTextField */, 48 | 3D2AAF6C20B6646A00A907DC /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 3D2AAF6C20B6646A00A907DC /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 3D2AAF6B20B6646A00A907DC /* DeleTextField.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 3D2AAF6D20B6646A00A907DC /* DeleTextField */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 3D2AAF6E20B6646A00A907DC /* AppDelegate.swift */, 64 | 3D2AAF7020B6646A00A907DC /* ViewController.swift */, 65 | 3D2AAF8020B6649400A907DC /* YMYCodeTextField.swift */, 66 | 3D2AAF8220B66B0900A907DC /* YMYCodeView.swift */, 67 | 3DEBB8B4217887130065207D /* TaxInputView.swift */, 68 | 3D2AAF7220B6646A00A907DC /* Main.storyboard */, 69 | 3D2AAF7520B6646A00A907DC /* Assets.xcassets */, 70 | 3D2AAF7720B6646A00A907DC /* LaunchScreen.storyboard */, 71 | 3D2AAF7A20B6646A00A907DC /* Info.plist */, 72 | ); 73 | path = DeleTextField; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | 3D2AAF6A20B6646A00A907DC /* DeleTextField */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = 3D2AAF7D20B6646A00A907DC /* Build configuration list for PBXNativeTarget "DeleTextField" */; 82 | buildPhases = ( 83 | 3D2AAF6720B6646A00A907DC /* Sources */, 84 | 3D2AAF6820B6646A00A907DC /* Frameworks */, 85 | 3D2AAF6920B6646A00A907DC /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = DeleTextField; 92 | productName = DeleTextField; 93 | productReference = 3D2AAF6B20B6646A00A907DC /* DeleTextField.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | 3D2AAF6320B6646A00A907DC /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastSwiftUpdateCheck = 0920; 103 | LastUpgradeCheck = 0920; 104 | ORGANIZATIONNAME = miniYang; 105 | TargetAttributes = { 106 | 3D2AAF6A20B6646A00A907DC = { 107 | CreatedOnToolsVersion = 9.2; 108 | ProvisioningStyle = Automatic; 109 | }; 110 | }; 111 | }; 112 | buildConfigurationList = 3D2AAF6620B6646A00A907DC /* Build configuration list for PBXProject "DeleTextField" */; 113 | compatibilityVersion = "Xcode 8.0"; 114 | developmentRegion = en; 115 | hasScannedForEncodings = 0; 116 | knownRegions = ( 117 | en, 118 | Base, 119 | ); 120 | mainGroup = 3D2AAF6220B6646A00A907DC; 121 | productRefGroup = 3D2AAF6C20B6646A00A907DC /* Products */; 122 | projectDirPath = ""; 123 | projectRoot = ""; 124 | targets = ( 125 | 3D2AAF6A20B6646A00A907DC /* DeleTextField */, 126 | ); 127 | }; 128 | /* End PBXProject section */ 129 | 130 | /* Begin PBXResourcesBuildPhase section */ 131 | 3D2AAF6920B6646A00A907DC /* Resources */ = { 132 | isa = PBXResourcesBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | 3D2AAF7920B6646A00A907DC /* LaunchScreen.storyboard in Resources */, 136 | 3D2AAF7620B6646A00A907DC /* Assets.xcassets in Resources */, 137 | 3D2AAF7420B6646A00A907DC /* Main.storyboard in Resources */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXResourcesBuildPhase section */ 142 | 143 | /* Begin PBXSourcesBuildPhase section */ 144 | 3D2AAF6720B6646A00A907DC /* Sources */ = { 145 | isa = PBXSourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 3D2AAF8320B66B0900A907DC /* YMYCodeView.swift in Sources */, 149 | 3D2AAF8120B6649400A907DC /* YMYCodeTextField.swift in Sources */, 150 | 3D2AAF7120B6646A00A907DC /* ViewController.swift in Sources */, 151 | 3D2AAF6F20B6646A00A907DC /* AppDelegate.swift in Sources */, 152 | 3DEBB8B5217887130065207D /* TaxInputView.swift in Sources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXSourcesBuildPhase section */ 157 | 158 | /* Begin PBXVariantGroup section */ 159 | 3D2AAF7220B6646A00A907DC /* Main.storyboard */ = { 160 | isa = PBXVariantGroup; 161 | children = ( 162 | 3D2AAF7320B6646A00A907DC /* Base */, 163 | ); 164 | name = Main.storyboard; 165 | sourceTree = ""; 166 | }; 167 | 3D2AAF7720B6646A00A907DC /* LaunchScreen.storyboard */ = { 168 | isa = PBXVariantGroup; 169 | children = ( 170 | 3D2AAF7820B6646A00A907DC /* Base */, 171 | ); 172 | name = LaunchScreen.storyboard; 173 | sourceTree = ""; 174 | }; 175 | /* End PBXVariantGroup section */ 176 | 177 | /* Begin XCBuildConfiguration section */ 178 | 3D2AAF7B20B6646A00A907DC /* Debug */ = { 179 | isa = XCBuildConfiguration; 180 | buildSettings = { 181 | ALWAYS_SEARCH_USER_PATHS = NO; 182 | CLANG_ANALYZER_NONNULL = YES; 183 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_COMMA = YES; 191 | CLANG_WARN_CONSTANT_CONVERSION = YES; 192 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 193 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 194 | CLANG_WARN_EMPTY_BODY = YES; 195 | CLANG_WARN_ENUM_CONVERSION = YES; 196 | CLANG_WARN_INFINITE_RECURSION = YES; 197 | CLANG_WARN_INT_CONVERSION = YES; 198 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 199 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 200 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 201 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 202 | CLANG_WARN_STRICT_PROTOTYPES = YES; 203 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 204 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 205 | CLANG_WARN_UNREACHABLE_CODE = YES; 206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 207 | CODE_SIGN_IDENTITY = "iPhone Developer"; 208 | COPY_PHASE_STRIP = NO; 209 | DEBUG_INFORMATION_FORMAT = dwarf; 210 | ENABLE_STRICT_OBJC_MSGSEND = YES; 211 | ENABLE_TESTABILITY = YES; 212 | GCC_C_LANGUAGE_STANDARD = gnu11; 213 | GCC_DYNAMIC_NO_PIC = NO; 214 | GCC_NO_COMMON_BLOCKS = YES; 215 | GCC_OPTIMIZATION_LEVEL = 0; 216 | GCC_PREPROCESSOR_DEFINITIONS = ( 217 | "DEBUG=1", 218 | "$(inherited)", 219 | ); 220 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 221 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 222 | GCC_WARN_UNDECLARED_SELECTOR = YES; 223 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 224 | GCC_WARN_UNUSED_FUNCTION = YES; 225 | GCC_WARN_UNUSED_VARIABLE = YES; 226 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 227 | MTL_ENABLE_DEBUG_INFO = YES; 228 | ONLY_ACTIVE_ARCH = YES; 229 | SDKROOT = iphoneos; 230 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 231 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 232 | }; 233 | name = Debug; 234 | }; 235 | 3D2AAF7C20B6646A00A907DC /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | CLANG_ANALYZER_NONNULL = YES; 240 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_MODULES = YES; 244 | CLANG_ENABLE_OBJC_ARC = YES; 245 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 246 | CLANG_WARN_BOOL_CONVERSION = YES; 247 | CLANG_WARN_COMMA = YES; 248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 257 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 258 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 259 | CLANG_WARN_STRICT_PROTOTYPES = YES; 260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 261 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | CODE_SIGN_IDENTITY = "iPhone Developer"; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 267 | ENABLE_NS_ASSERTIONS = NO; 268 | ENABLE_STRICT_OBJC_MSGSEND = YES; 269 | GCC_C_LANGUAGE_STANDARD = gnu11; 270 | GCC_NO_COMMON_BLOCKS = YES; 271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 273 | GCC_WARN_UNDECLARED_SELECTOR = YES; 274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 275 | GCC_WARN_UNUSED_FUNCTION = YES; 276 | GCC_WARN_UNUSED_VARIABLE = YES; 277 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 278 | MTL_ENABLE_DEBUG_INFO = NO; 279 | SDKROOT = iphoneos; 280 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 281 | VALIDATE_PRODUCT = YES; 282 | }; 283 | name = Release; 284 | }; 285 | 3D2AAF7E20B6646A00A907DC /* Debug */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CODE_SIGN_STYLE = Automatic; 290 | DEVELOPMENT_TEAM = T4SAW3YARN; 291 | INFOPLIST_FILE = DeleTextField/Info.plist; 292 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 293 | PRODUCT_BUNDLE_IDENTIFIER = Akulaku.DeleTextField; 294 | PRODUCT_NAME = "$(TARGET_NAME)"; 295 | SWIFT_VERSION = 4.0; 296 | TARGETED_DEVICE_FAMILY = "1,2"; 297 | }; 298 | name = Debug; 299 | }; 300 | 3D2AAF7F20B6646A00A907DC /* Release */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 304 | CODE_SIGN_STYLE = Automatic; 305 | DEVELOPMENT_TEAM = T4SAW3YARN; 306 | INFOPLIST_FILE = DeleTextField/Info.plist; 307 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 308 | PRODUCT_BUNDLE_IDENTIFIER = Akulaku.DeleTextField; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | SWIFT_VERSION = 4.0; 311 | TARGETED_DEVICE_FAMILY = "1,2"; 312 | }; 313 | name = Release; 314 | }; 315 | /* End XCBuildConfiguration section */ 316 | 317 | /* Begin XCConfigurationList section */ 318 | 3D2AAF6620B6646A00A907DC /* Build configuration list for PBXProject "DeleTextField" */ = { 319 | isa = XCConfigurationList; 320 | buildConfigurations = ( 321 | 3D2AAF7B20B6646A00A907DC /* Debug */, 322 | 3D2AAF7C20B6646A00A907DC /* Release */, 323 | ); 324 | defaultConfigurationIsVisible = 0; 325 | defaultConfigurationName = Release; 326 | }; 327 | 3D2AAF7D20B6646A00A907DC /* Build configuration list for PBXNativeTarget "DeleTextField" */ = { 328 | isa = XCConfigurationList; 329 | buildConfigurations = ( 330 | 3D2AAF7E20B6646A00A907DC /* Debug */, 331 | 3D2AAF7F20B6646A00A907DC /* Release */, 332 | ); 333 | defaultConfigurationIsVisible = 0; 334 | defaultConfigurationName = Release; 335 | }; 336 | /* End XCConfigurationList section */ 337 | }; 338 | rootObject = 3D2AAF6320B6646A00A907DC /* Project object */; 339 | } 340 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/project.xcworkspace/xcuserdata/mini.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangminiOS/CodeField/6f2f19366e0eda22bcd78a683460f03902977ca1/DeleTextField.xcodeproj/project.xcworkspace/xcuserdata/mini.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/project.xcworkspace/xcuserdata/yangmin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangminiOS/CodeField/6f2f19366e0eda22bcd78a683460f03902977ca1/DeleTextField.xcodeproj/project.xcworkspace/xcuserdata/yangmin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/xcuserdata/mini.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/xcuserdata/mini.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DeleTextField.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/xcuserdata/yangmin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DeleTextField.xcodeproj/xcuserdata/yangmin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DeleTextField.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DeleTextField/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DeleTextField 4 | // 5 | // Created by mini on 2018/5/24. 6 | // Copyright © 2018年 miniYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /DeleTextField/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /DeleTextField/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 | -------------------------------------------------------------------------------- /DeleTextField/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 | -------------------------------------------------------------------------------- /DeleTextField/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DeleTextField/TaxInputView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TaxInputView.swift 3 | // AKCreditScore 4 | // 5 | // Created by WangChongyang on 2018/6/19. 6 | // 7 | 8 | import UIKit 9 | 10 | @objc protocol TaxInputViewDelegate { 11 | 12 | @objc optional func taxInputViewDidChange(_ taxInputView: TaxInputView) 13 | 14 | @objc optional func taxInputViewBeginInput(_ taxInputView: TaxInputView) 15 | 16 | @objc optional func taxInputViewEndInput(_ taxInputView: TaxInputView) 17 | 18 | @objc optional func taxInputViewCompleteInput(_ taxInputView: TaxInputView) 19 | 20 | } 21 | 22 | class TaxInputView: UIView, UIKeyInput { 23 | 24 | 25 | 26 | override var canBecomeFirstResponder: Bool { 27 | return true 28 | } 29 | 30 | private var _keyboardType: UIKeyboardType? 31 | 32 | var keyboardType: UIKeyboardType { 33 | 34 | get { return .numberPad } 35 | 36 | set {} 37 | 38 | } 39 | 40 | private lazy var numberSet = CharacterSet(charactersIn: "0123456789").inverted 41 | 42 | var taxNum: Int = 6 { 43 | didSet { 44 | setNeedsDisplay() 45 | } 46 | } 47 | 48 | private var gapWidth: CGFloat = 30 { 49 | didSet { 50 | setNeedsDisplay() 51 | } 52 | } 53 | 54 | private var textAttr: [NSAttributedStringKey: Any] { 55 | return [.font : font, .foregroundColor: textColor] 56 | } 57 | 58 | private lazy var cursorAnimation: CABasicAnimation = { 59 | 60 | let animation = CABasicAnimation(keyPath: "opacity") 61 | 62 | animation.fromValue = 1.0 63 | 64 | animation.toValue = 0.0 65 | 66 | animation.autoreverses = true 67 | 68 | animation.duration = 0.5 69 | 70 | animation.repeatCount = MAXFLOAT 71 | 72 | animation.isRemovedOnCompletion = false 73 | 74 | animation.fillMode = kCAFillModeForwards 75 | 76 | animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn) 77 | 78 | return animation 79 | 80 | }() 81 | 82 | private let cursorView = UIView() 83 | 84 | private var _font: UIFont? 85 | 86 | private var _textColor: UIColor? 87 | 88 | private var _activeColor = UIColor.init(red: 255.0/255, green: 153.0/255, blue: 51/255, alpha: 1.0) 89 | 90 | private var _defaultColor = UIColor.black //UIColor.init(red: 239.0/255, green: 239.0/255, blue: 244.0/255, alpha: 1.0) 91 | 92 | var font: UIFont { 93 | 94 | get { 95 | return _font ?? UIFont.systemFont(ofSize: 14) 96 | } 97 | 98 | set { 99 | _font = newValue 100 | } 101 | 102 | } 103 | 104 | var textColor: UIColor { 105 | 106 | get { 107 | return _textColor ?? .black 108 | } 109 | 110 | set { 111 | _textColor = newValue 112 | } 113 | 114 | } 115 | 116 | var activeColor: UIColor { 117 | 118 | get { 119 | return _activeColor 120 | } 121 | 122 | set { 123 | 124 | _activeColor = newValue 125 | 126 | cursorView.backgroundColor = newValue 127 | 128 | } 129 | 130 | } 131 | 132 | var text = "" 133 | 134 | weak var delegate: TaxInputViewDelegate? 135 | 136 | override init(frame: CGRect) { 137 | 138 | super.init(frame: frame) 139 | 140 | backgroundColor = .white 141 | 142 | cursorView.backgroundColor = activeColor 143 | 144 | cursorView.layer.add(cursorAnimation, forKey: "cursor") 145 | 146 | } 147 | 148 | required init?(coder aDecoder: NSCoder) { 149 | fatalError("init(coder:) has not been implemented") 150 | } 151 | 152 | @discardableResult 153 | override func becomeFirstResponder() -> Bool { 154 | delegate?.taxInputViewBeginInput?(self) 155 | setNeedsDisplay() 156 | return super.becomeFirstResponder() 157 | } 158 | 159 | @discardableResult 160 | override func resignFirstResponder() -> Bool { 161 | delegate?.taxInputViewEndInput?(self) 162 | setNeedsDisplay() 163 | return super.resignFirstResponder() 164 | } 165 | 166 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 167 | if !isFirstResponder { 168 | becomeFirstResponder() 169 | } 170 | } 171 | 172 | // MARK: UIKeyInput 173 | var hasText: Bool { 174 | return text.count > 0 175 | } 176 | 177 | func insertText(_ text: String) { 178 | 179 | if self.text.count < taxNum { 180 | 181 | let aText = text.components(separatedBy: numberSet).joined(separator: "") 182 | 183 | if text == aText { 184 | 185 | self.text.append(text) 186 | 187 | delegate?.taxInputViewDidChange?(self) 188 | 189 | if self.text.count == taxNum { 190 | delegate?.taxInputViewCompleteInput?(self) 191 | } 192 | 193 | setNeedsDisplay() 194 | 195 | } 196 | 197 | } 198 | 199 | } 200 | 201 | func deleteBackward() { 202 | 203 | if text.count > 0 { 204 | 205 | text.removeLast() 206 | 207 | delegate?.taxInputViewDidChange?(self) 208 | 209 | setNeedsDisplay() 210 | 211 | } 212 | 213 | } 214 | 215 | // MARK: draw 216 | override func draw(_ rect: CGRect) { 217 | 218 | cursorView.removeFromSuperview() 219 | 220 | let height = rect.height 221 | 222 | let rectWidth: CGFloat = 30.0 223 | 224 | let y = height - 0.5 225 | 226 | let color = _defaultColor.cgColor 227 | 228 | let context = UIGraphicsGetCurrentContext() 229 | context?.setLineWidth(0.5) 230 | context?.setFillColor(color) 231 | 232 | var startPoint: CGPoint 233 | 234 | var endPoint: CGPoint 235 | 236 | let characterCount = text.count 237 | 238 | for i in 0.. 0, i < characterCount { 276 | 277 | let idx = text.index(text.startIndex, offsetBy: i) 278 | let str = String(text[idx]) as NSString 279 | 280 | var drawIndex = i 281 | 282 | if drawIndex >= 9, drawIndex < taxNum { 283 | drawIndex = drawIndex + 1 284 | } 285 | 286 | let strSize = str.size(withAttributes: textAttr) 287 | 288 | let x = CGFloat(drawIndex) * (rectWidth + gapWidth) + (rectWidth - strSize.width) / 2 289 | let rect = CGRect(x: x, y: 8, width: strSize.width, height: height - CGFloat(16)) 290 | 291 | str.draw(in: rect, withAttributes: textAttr) 292 | 293 | } 294 | 295 | } 296 | 297 | } 298 | 299 | } 300 | -------------------------------------------------------------------------------- /DeleTextField/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DeleTextField 4 | // 5 | // Created by mini on 2018/5/24. 6 | // Copyright © 2018年 miniYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, TaxInputViewDelegate { 12 | 13 | var taxInputView: TaxInputView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | taxInputView = TaxInputView() 19 | taxInputView.delegate = self 20 | view.addSubview(taxInputView) 21 | 22 | taxInputView.frame = CGRect.init(x: 20, y: 100, width: view.frame.width - 40, height: 35) 23 | } 24 | 25 | func codeView(_ inputString: String) { 26 | print(inputString) 27 | 28 | } 29 | 30 | 31 | override func didReceiveMemoryWarning() { 32 | super.didReceiveMemoryWarning() 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 37 | //codeView.registFirst() 38 | taxInputView.resignFirstResponder() 39 | } 40 | 41 | func taxInputViewCompleteInput(_ taxInputView: TaxInputView) { 42 | print(taxInputView.text) 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /DeleTextField/YMYCodeTextField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DTextField.swift 3 | // DeleTextField 4 | // 5 | // Created by mini on 2018/5/24. 6 | // Copyright © 2018年 miniYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class YMCodeTextField: UITextField { 12 | 13 | weak var keyInputDelegate: keyInputTextFieldDelegate? 14 | 15 | override func deleteBackward() { 16 | super.deleteBackward() 17 | 18 | if(keyInputDelegate != nil) { 19 | 20 | keyInputDelegate?.deleBackward() 21 | } 22 | } 23 | } 24 | 25 | protocol keyInputTextFieldDelegate: class { 26 | func deleBackward() 27 | } 28 | -------------------------------------------------------------------------------- /DeleTextField/YMYCodeView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YMCodeView.swift 3 | // DeleTextField 4 | // 5 | // Created by mini on 2018/5/24. 6 | // Copyright © 2018年 miniYang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class YMCodeView: UIView, keyInputTextFieldDelegate, UITextFieldDelegate { 12 | 13 | var delegate: YMCodeViewDelegate? 14 | 15 | var defaultColor = UIColor.init(red: 239.0/255, green: 239.0/255, blue: 244.0/255, alpha: 1.0) 16 | var heightColor = UIColor.init(red: 245.0/255, green: 106.0/255, blue: 32.0/255, alpha: 1.0) 17 | var lineErrorColor = UIColor.init(red: 236.0/255, green: 0.0, blue: 26.0/255, alpha: 1.0) 18 | //item 的数量 19 | public var itemCount: Int = 5 20 | //item 的宽度 21 | public var itemWith: CGFloat = 30.0 22 | //item 到父视图的左右间隙 默认是0 23 | public var margin_LR: CGFloat = 0.0 24 | //item 的宽度 25 | public var titleSize:CGFloat = 20.0 26 | 27 | var textFields: [YMCodeTextField] = [] 28 | var lines: [UIView] = [] 29 | var firstTextField: YMCodeTextField? 30 | var firstLine: UIView? 31 | var index: Int = 0 32 | var isLastFill: Bool = false 33 | var inputString: String = "" 34 | 35 | public convenience init(count: Int, with: CGFloat = 0) { 36 | 37 | self.init() 38 | if(count < 1 || count > 6) { 39 | 40 | itemCount = 6 41 | }else { 42 | 43 | itemCount = count 44 | } 45 | 46 | if(with <= 0){ 47 | itemWith = 30.0 48 | }else { 49 | itemWith = with 50 | } 51 | 52 | configTextField(itemCount) 53 | } 54 | 55 | func configTextField(_ count: Int) { 56 | 57 | for _ in 0.. 1) { 100 | //let endIndex = textField.text!.index(textField.text!.startIndex, offsetBy: 1) 101 | textField.text = "\(textField.text!.first!)" 102 | } 103 | textField.isEnabled = false 104 | firstTextField = textFields[index] 105 | firstTextField?.isEnabled = true 106 | firstTextField?.becomeFirstResponder() 107 | } 108 | 109 | public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { 110 | 111 | if(string.count > 0) { 112 | inputString = inputString.appending(string) 113 | 114 | if(index == (itemCount - 1)) { 115 | if(delegate != nil) { 116 | delegate?.codeView(inputString) 117 | } 118 | isLastFill = true 119 | index += 1 120 | let line = lines[index] 121 | line.backgroundColor = heightColor 122 | firstLine = line 123 | } 124 | 125 | } 126 | return true 127 | } 128 | 129 | public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { 130 | 131 | firstLine?.backgroundColor = heightColor 132 | return true 133 | } 134 | 135 | public func textFieldDidEndEditing(_ textField: UITextField) { 136 | 137 | let tempIndex: Int = textFields.index(of: textField as! YMCodeTextField) ?? 0 138 | 139 | let line = lines[tempIndex] 140 | 141 | line.backgroundColor = defaultColor 142 | 143 | } 144 | 145 | public override func touchesBegan(_ touches: Set, with event: UIEvent?) { 146 | 147 | firstTextField?.isEnabled = true 148 | firstTextField?.becomeFirstResponder() 149 | firstLine?.backgroundColor = heightColor 150 | } 151 | 152 | 153 | //激活状态 154 | func beComeFirst() { 155 | 156 | firstTextField?.isEnabled = true 157 | firstTextField?.becomeFirstResponder() 158 | firstLine?.backgroundColor = heightColor 159 | } 160 | 161 | //静默状态 162 | func registFirst() { 163 | 164 | firstTextField?.resignFirstResponder() 165 | firstLine?.backgroundColor = defaultColor 166 | } 167 | 168 | //错误码 下划线显示的颜色 169 | public func linesErrorColor() { 170 | for line in lines { 171 | line.backgroundColor = lineErrorColor 172 | } 173 | } 174 | 175 | //真确的情况下 下划线的颜色 176 | func linesDefaultColor() { 177 | for line in lines { 178 | line.backgroundColor = defaultColor 179 | } 180 | } 181 | 182 | 183 | 184 | } 185 | 186 | protocol YMCodeViewDelegate :class { 187 | func codeView(_ inputString: String) 188 | } 189 | 190 | 191 | extension YMCodeView { 192 | 193 | func deleBackward() { 194 | 195 | //如果是最后一个 field 196 | if(isLastFill) { 197 | isLastFill = false 198 | firstTextField?.isEnabled = true 199 | firstTextField?.becomeFirstResponder() 200 | firstTextField?.text = "" 201 | 202 | }else if(index >= 1){ 203 | //let line = lines[index] 204 | //line.backgroundColor = defaultColor 205 | firstTextField?.isEnabled = false 206 | index -= 1 207 | firstTextField = textFields[index] 208 | firstLine = lines[index] 209 | firstTextField?.isEnabled = true 210 | firstTextField?.text = "" 211 | firstTextField?.becomeFirstResponder() 212 | } 213 | 214 | if(inputString.count >= 1) { 215 | let endIndex = inputString.index(before: inputString.endIndex) 216 | let tempString = String(inputString[inputString.startIndex..