├── Example ├── ValidateIt.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── ValidateIt.xccheckout │ │ └── xcuserdata │ │ │ ├── RP.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── sepodermardirousian.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── RP.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ ├── ValidateIt.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── sepodermardirousian.xcuserdatad │ │ └── xcschemes │ │ ├── ValidateIt.xcscheme │ │ └── xcschememanagement.plist ├── ValidateIt │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── ValidateIt-Info.plist │ ├── ValidateIt-Prefix.pch │ ├── ViewController.h │ ├── ViewController.m │ ├── correct.png │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── incorrect.png │ ├── main.m │ ├── validation.h │ └── validation.m └── ValidateItTests │ ├── ValidateItTests-Info.plist │ ├── ValidateItTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md └── ValidateIt Library ├── validation.h └── validation.m /Example/ValidateIt.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F0729F251898694A00886CF3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F241898694A00886CF3 /* Foundation.framework */; }; 11 | F0729F271898694A00886CF3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F261898694A00886CF3 /* CoreGraphics.framework */; }; 12 | F0729F291898694A00886CF3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F281898694A00886CF3 /* UIKit.framework */; }; 13 | F0729F2F1898694A00886CF3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F0729F2D1898694A00886CF3 /* InfoPlist.strings */; }; 14 | F0729F311898694A00886CF3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F0729F301898694A00886CF3 /* main.m */; }; 15 | F0729F351898694A00886CF3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F0729F341898694A00886CF3 /* AppDelegate.m */; }; 16 | F0729F381898694A00886CF3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0729F361898694A00886CF3 /* Main.storyboard */; }; 17 | F0729F3B1898694A00886CF3 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0729F3A1898694A00886CF3 /* ViewController.m */; }; 18 | F0729F3D1898694A00886CF3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F0729F3C1898694A00886CF3 /* Images.xcassets */; }; 19 | F0729F441898694A00886CF3 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F431898694A00886CF3 /* XCTest.framework */; }; 20 | F0729F451898694A00886CF3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F241898694A00886CF3 /* Foundation.framework */; }; 21 | F0729F461898694A00886CF3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0729F281898694A00886CF3 /* UIKit.framework */; }; 22 | F0729F4E1898694A00886CF3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F0729F4C1898694A00886CF3 /* InfoPlist.strings */; }; 23 | F0729F501898694A00886CF3 /* ValidateItTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F0729F4F1898694A00886CF3 /* ValidateItTests.m */; }; 24 | F09BB9DC189869EF00E119F0 /* validation.m in Sources */ = {isa = PBXBuildFile; fileRef = F09BB9DB189869EF00E119F0 /* validation.m */; }; 25 | F09BB9E01898763B00E119F0 /* correct.png in Resources */ = {isa = PBXBuildFile; fileRef = F09BB9DE1898763B00E119F0 /* correct.png */; }; 26 | F09BB9E318987B1200E119F0 /* incorrect.png in Resources */ = {isa = PBXBuildFile; fileRef = F09BB9E218987B1200E119F0 /* incorrect.png */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | F0729F471898694A00886CF3 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = F0729F191898694A00886CF3 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = F0729F201898694A00886CF3; 35 | remoteInfo = ValidateIt; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | F0729F211898694A00886CF3 /* ValidateIt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ValidateIt.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | F0729F241898694A00886CF3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 42 | F0729F261898694A00886CF3 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 43 | F0729F281898694A00886CF3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 44 | F0729F2C1898694A00886CF3 /* ValidateIt-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ValidateIt-Info.plist"; sourceTree = ""; }; 45 | F0729F2E1898694A00886CF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 46 | F0729F301898694A00886CF3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 47 | F0729F321898694A00886CF3 /* ValidateIt-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ValidateIt-Prefix.pch"; sourceTree = ""; }; 48 | F0729F331898694A00886CF3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | F0729F341898694A00886CF3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | F0729F371898694A00886CF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | F0729F391898694A00886CF3 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 52 | F0729F3A1898694A00886CF3 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 53 | F0729F3C1898694A00886CF3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 54 | F0729F421898694A00886CF3 /* ValidateItTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ValidateItTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | F0729F431898694A00886CF3 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 56 | F0729F4B1898694A00886CF3 /* ValidateItTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ValidateItTests-Info.plist"; sourceTree = ""; }; 57 | F0729F4D1898694A00886CF3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | F0729F4F1898694A00886CF3 /* ValidateItTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ValidateItTests.m; sourceTree = ""; }; 59 | F09BB9DA189869EF00E119F0 /* validation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validation.h; sourceTree = ""; }; 60 | F09BB9DB189869EF00E119F0 /* validation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = validation.m; sourceTree = ""; }; 61 | F09BB9DE1898763B00E119F0 /* correct.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = correct.png; sourceTree = ""; }; 62 | F09BB9E218987B1200E119F0 /* incorrect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = incorrect.png; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | F0729F1E1898694A00886CF3 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | F0729F271898694A00886CF3 /* CoreGraphics.framework in Frameworks */, 71 | F0729F291898694A00886CF3 /* UIKit.framework in Frameworks */, 72 | F0729F251898694A00886CF3 /* Foundation.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | F0729F3F1898694A00886CF3 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | F0729F441898694A00886CF3 /* XCTest.framework in Frameworks */, 81 | F0729F461898694A00886CF3 /* UIKit.framework in Frameworks */, 82 | F0729F451898694A00886CF3 /* Foundation.framework in Frameworks */, 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | F0729F181898694A00886CF3 = { 90 | isa = PBXGroup; 91 | children = ( 92 | F0729F2A1898694A00886CF3 /* ValidateIt */, 93 | F0729F491898694A00886CF3 /* ValidateItTests */, 94 | F0729F231898694A00886CF3 /* Frameworks */, 95 | F0729F221898694A00886CF3 /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | F0729F221898694A00886CF3 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | F0729F211898694A00886CF3 /* ValidateIt.app */, 103 | F0729F421898694A00886CF3 /* ValidateItTests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | F0729F231898694A00886CF3 /* Frameworks */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | F0729F241898694A00886CF3 /* Foundation.framework */, 112 | F0729F261898694A00886CF3 /* CoreGraphics.framework */, 113 | F0729F281898694A00886CF3 /* UIKit.framework */, 114 | F0729F431898694A00886CF3 /* XCTest.framework */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | F0729F2A1898694A00886CF3 /* ValidateIt */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | F09BB9DD1898760C00E119F0 /* img */, 123 | F0729F591898695E00886CF3 /* ValidateIt Library */, 124 | F0729F331898694A00886CF3 /* AppDelegate.h */, 125 | F0729F341898694A00886CF3 /* AppDelegate.m */, 126 | F0729F361898694A00886CF3 /* Main.storyboard */, 127 | F0729F391898694A00886CF3 /* ViewController.h */, 128 | F0729F3A1898694A00886CF3 /* ViewController.m */, 129 | F0729F3C1898694A00886CF3 /* Images.xcassets */, 130 | F0729F2B1898694A00886CF3 /* Supporting Files */, 131 | ); 132 | path = ValidateIt; 133 | sourceTree = ""; 134 | }; 135 | F0729F2B1898694A00886CF3 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | F0729F2C1898694A00886CF3 /* ValidateIt-Info.plist */, 139 | F0729F2D1898694A00886CF3 /* InfoPlist.strings */, 140 | F0729F301898694A00886CF3 /* main.m */, 141 | F0729F321898694A00886CF3 /* ValidateIt-Prefix.pch */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | F0729F491898694A00886CF3 /* ValidateItTests */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | F0729F4F1898694A00886CF3 /* ValidateItTests.m */, 150 | F0729F4A1898694A00886CF3 /* Supporting Files */, 151 | ); 152 | path = ValidateItTests; 153 | sourceTree = ""; 154 | }; 155 | F0729F4A1898694A00886CF3 /* Supporting Files */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | F0729F4B1898694A00886CF3 /* ValidateItTests-Info.plist */, 159 | F0729F4C1898694A00886CF3 /* InfoPlist.strings */, 160 | ); 161 | name = "Supporting Files"; 162 | sourceTree = ""; 163 | }; 164 | F0729F591898695E00886CF3 /* ValidateIt Library */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | F09BB9DA189869EF00E119F0 /* validation.h */, 168 | F09BB9DB189869EF00E119F0 /* validation.m */, 169 | ); 170 | name = "ValidateIt Library"; 171 | sourceTree = ""; 172 | }; 173 | F09BB9DD1898760C00E119F0 /* img */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | F09BB9DE1898763B00E119F0 /* correct.png */, 177 | F09BB9E218987B1200E119F0 /* incorrect.png */, 178 | ); 179 | name = img; 180 | sourceTree = ""; 181 | }; 182 | /* End PBXGroup section */ 183 | 184 | /* Begin PBXNativeTarget section */ 185 | F0729F201898694A00886CF3 /* ValidateIt */ = { 186 | isa = PBXNativeTarget; 187 | buildConfigurationList = F0729F531898694A00886CF3 /* Build configuration list for PBXNativeTarget "ValidateIt" */; 188 | buildPhases = ( 189 | F0729F1D1898694A00886CF3 /* Sources */, 190 | F0729F1E1898694A00886CF3 /* Frameworks */, 191 | F0729F1F1898694A00886CF3 /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | ); 197 | name = ValidateIt; 198 | productName = ValidateIt; 199 | productReference = F0729F211898694A00886CF3 /* ValidateIt.app */; 200 | productType = "com.apple.product-type.application"; 201 | }; 202 | F0729F411898694A00886CF3 /* ValidateItTests */ = { 203 | isa = PBXNativeTarget; 204 | buildConfigurationList = F0729F561898694A00886CF3 /* Build configuration list for PBXNativeTarget "ValidateItTests" */; 205 | buildPhases = ( 206 | F0729F3E1898694A00886CF3 /* Sources */, 207 | F0729F3F1898694A00886CF3 /* Frameworks */, 208 | F0729F401898694A00886CF3 /* Resources */, 209 | ); 210 | buildRules = ( 211 | ); 212 | dependencies = ( 213 | F0729F481898694A00886CF3 /* PBXTargetDependency */, 214 | ); 215 | name = ValidateItTests; 216 | productName = ValidateItTests; 217 | productReference = F0729F421898694A00886CF3 /* ValidateItTests.xctest */; 218 | productType = "com.apple.product-type.bundle.unit-test"; 219 | }; 220 | /* End PBXNativeTarget section */ 221 | 222 | /* Begin PBXProject section */ 223 | F0729F191898694A00886CF3 /* Project object */ = { 224 | isa = PBXProject; 225 | attributes = { 226 | LastUpgradeCheck = 0500; 227 | ORGANIZATIONNAME = ValidateIt; 228 | TargetAttributes = { 229 | F0729F411898694A00886CF3 = { 230 | TestTargetID = F0729F201898694A00886CF3; 231 | }; 232 | }; 233 | }; 234 | buildConfigurationList = F0729F1C1898694A00886CF3 /* Build configuration list for PBXProject "ValidateIt" */; 235 | compatibilityVersion = "Xcode 3.2"; 236 | developmentRegion = English; 237 | hasScannedForEncodings = 0; 238 | knownRegions = ( 239 | en, 240 | Base, 241 | ); 242 | mainGroup = F0729F181898694A00886CF3; 243 | productRefGroup = F0729F221898694A00886CF3 /* Products */; 244 | projectDirPath = ""; 245 | projectRoot = ""; 246 | targets = ( 247 | F0729F201898694A00886CF3 /* ValidateIt */, 248 | F0729F411898694A00886CF3 /* ValidateItTests */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | F0729F1F1898694A00886CF3 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | F09BB9E318987B1200E119F0 /* incorrect.png in Resources */, 259 | F09BB9E01898763B00E119F0 /* correct.png in Resources */, 260 | F0729F3D1898694A00886CF3 /* Images.xcassets in Resources */, 261 | F0729F2F1898694A00886CF3 /* InfoPlist.strings in Resources */, 262 | F0729F381898694A00886CF3 /* Main.storyboard in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | F0729F401898694A00886CF3 /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | F0729F4E1898694A00886CF3 /* InfoPlist.strings in Resources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | /* End PBXResourcesBuildPhase section */ 275 | 276 | /* Begin PBXSourcesBuildPhase section */ 277 | F0729F1D1898694A00886CF3 /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | F0729F3B1898694A00886CF3 /* ViewController.m in Sources */, 282 | F0729F351898694A00886CF3 /* AppDelegate.m in Sources */, 283 | F09BB9DC189869EF00E119F0 /* validation.m in Sources */, 284 | F0729F311898694A00886CF3 /* main.m in Sources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | F0729F3E1898694A00886CF3 /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | F0729F501898694A00886CF3 /* ValidateItTests.m in Sources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | /* End PBXSourcesBuildPhase section */ 297 | 298 | /* Begin PBXTargetDependency section */ 299 | F0729F481898694A00886CF3 /* PBXTargetDependency */ = { 300 | isa = PBXTargetDependency; 301 | target = F0729F201898694A00886CF3 /* ValidateIt */; 302 | targetProxy = F0729F471898694A00886CF3 /* PBXContainerItemProxy */; 303 | }; 304 | /* End PBXTargetDependency section */ 305 | 306 | /* Begin PBXVariantGroup section */ 307 | F0729F2D1898694A00886CF3 /* InfoPlist.strings */ = { 308 | isa = PBXVariantGroup; 309 | children = ( 310 | F0729F2E1898694A00886CF3 /* en */, 311 | ); 312 | name = InfoPlist.strings; 313 | sourceTree = ""; 314 | }; 315 | F0729F361898694A00886CF3 /* Main.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | F0729F371898694A00886CF3 /* Base */, 319 | ); 320 | name = Main.storyboard; 321 | sourceTree = ""; 322 | }; 323 | F0729F4C1898694A00886CF3 /* InfoPlist.strings */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | F0729F4D1898694A00886CF3 /* en */, 327 | ); 328 | name = InfoPlist.strings; 329 | sourceTree = ""; 330 | }; 331 | /* End PBXVariantGroup section */ 332 | 333 | /* Begin XCBuildConfiguration section */ 334 | F0729F511898694A00886CF3 /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 350 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 351 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 352 | COPY_PHASE_STRIP = NO; 353 | GCC_C_LANGUAGE_STANDARD = gnu99; 354 | GCC_DYNAMIC_NO_PIC = NO; 355 | GCC_OPTIMIZATION_LEVEL = 0; 356 | GCC_PREPROCESSOR_DEFINITIONS = ( 357 | "DEBUG=1", 358 | "$(inherited)", 359 | ); 360 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 368 | ONLY_ACTIVE_ARCH = YES; 369 | SDKROOT = iphoneos; 370 | }; 371 | name = Debug; 372 | }; 373 | F0729F521898694A00886CF3 /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_CONSTANT_CONVERSION = YES; 384 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 385 | CLANG_WARN_EMPTY_BODY = YES; 386 | CLANG_WARN_ENUM_CONVERSION = YES; 387 | CLANG_WARN_INT_CONVERSION = YES; 388 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 389 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 390 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 391 | COPY_PHASE_STRIP = YES; 392 | ENABLE_NS_ASSERTIONS = NO; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 395 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 396 | GCC_WARN_UNDECLARED_SELECTOR = YES; 397 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 398 | GCC_WARN_UNUSED_FUNCTION = YES; 399 | GCC_WARN_UNUSED_VARIABLE = YES; 400 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 401 | SDKROOT = iphoneos; 402 | VALIDATE_PRODUCT = YES; 403 | }; 404 | name = Release; 405 | }; 406 | F0729F541898694A00886CF3 /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 411 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 412 | GCC_PREFIX_HEADER = "ValidateIt/ValidateIt-Prefix.pch"; 413 | INFOPLIST_FILE = "ValidateIt/ValidateIt-Info.plist"; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | WRAPPER_EXTENSION = app; 416 | }; 417 | name = Debug; 418 | }; 419 | F0729F551898694A00886CF3 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 423 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 424 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 425 | GCC_PREFIX_HEADER = "ValidateIt/ValidateIt-Prefix.pch"; 426 | INFOPLIST_FILE = "ValidateIt/ValidateIt-Info.plist"; 427 | PRODUCT_NAME = "$(TARGET_NAME)"; 428 | WRAPPER_EXTENSION = app; 429 | }; 430 | name = Release; 431 | }; 432 | F0729F571898694A00886CF3 /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 436 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ValidateIt.app/ValidateIt"; 437 | FRAMEWORK_SEARCH_PATHS = ( 438 | "$(SDKROOT)/Developer/Library/Frameworks", 439 | "$(inherited)", 440 | "$(DEVELOPER_FRAMEWORKS_DIR)", 441 | ); 442 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 443 | GCC_PREFIX_HEADER = "ValidateIt/ValidateIt-Prefix.pch"; 444 | GCC_PREPROCESSOR_DEFINITIONS = ( 445 | "DEBUG=1", 446 | "$(inherited)", 447 | ); 448 | INFOPLIST_FILE = "ValidateItTests/ValidateItTests-Info.plist"; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | TEST_HOST = "$(BUNDLE_LOADER)"; 451 | WRAPPER_EXTENSION = xctest; 452 | }; 453 | name = Debug; 454 | }; 455 | F0729F581898694A00886CF3 /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 459 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ValidateIt.app/ValidateIt"; 460 | FRAMEWORK_SEARCH_PATHS = ( 461 | "$(SDKROOT)/Developer/Library/Frameworks", 462 | "$(inherited)", 463 | "$(DEVELOPER_FRAMEWORKS_DIR)", 464 | ); 465 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 466 | GCC_PREFIX_HEADER = "ValidateIt/ValidateIt-Prefix.pch"; 467 | INFOPLIST_FILE = "ValidateItTests/ValidateItTests-Info.plist"; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | TEST_HOST = "$(BUNDLE_LOADER)"; 470 | WRAPPER_EXTENSION = xctest; 471 | }; 472 | name = Release; 473 | }; 474 | /* End XCBuildConfiguration section */ 475 | 476 | /* Begin XCConfigurationList section */ 477 | F0729F1C1898694A00886CF3 /* Build configuration list for PBXProject "ValidateIt" */ = { 478 | isa = XCConfigurationList; 479 | buildConfigurations = ( 480 | F0729F511898694A00886CF3 /* Debug */, 481 | F0729F521898694A00886CF3 /* Release */, 482 | ); 483 | defaultConfigurationIsVisible = 0; 484 | defaultConfigurationName = Release; 485 | }; 486 | F0729F531898694A00886CF3 /* Build configuration list for PBXNativeTarget "ValidateIt" */ = { 487 | isa = XCConfigurationList; 488 | buildConfigurations = ( 489 | F0729F541898694A00886CF3 /* Debug */, 490 | F0729F551898694A00886CF3 /* Release */, 491 | ); 492 | defaultConfigurationIsVisible = 0; 493 | defaultConfigurationName = Release; 494 | }; 495 | F0729F561898694A00886CF3 /* Build configuration list for PBXNativeTarget "ValidateItTests" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | F0729F571898694A00886CF3 /* Debug */, 499 | F0729F581898694A00886CF3 /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | /* End XCConfigurationList section */ 505 | }; 506 | rootObject = F0729F191898694A00886CF3 /* Project object */; 507 | } 508 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/project.xcworkspace/xcshareddata/ValidateIt.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | E7A65276-FDE5-437A-8D96-8FAA2EFCD4AB 9 | IDESourceControlProjectName 10 | ValidateIt 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 64B2A9D2-E04B-4998-AE52-7A3A23ED9A72 14 | https://github.com/arpi6/validateIt.git 15 | 16 | IDESourceControlProjectPath 17 | Example/ValidateIt.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 64B2A9D2-E04B-4998-AE52-7A3A23ED9A72 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/arpi6/validateIt.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 64B2A9D2-E04B-4998-AE52-7A3A23ED9A72 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 64B2A9D2-E04B-4998-AE52-7A3A23ED9A72 36 | IDESourceControlWCCName 37 | validateIt 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/project.xcworkspace/xcuserdata/RP.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arpi6/validateIt/9d7eed98807abe62109b35937b3fbacd29aee286/Example/ValidateIt.xcodeproj/project.xcworkspace/xcuserdata/RP.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/project.xcworkspace/xcuserdata/sepodermardirousian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arpi6/validateIt/9d7eed98807abe62109b35937b3fbacd29aee286/Example/ValidateIt.xcodeproj/project.xcworkspace/xcuserdata/sepodermardirousian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/xcuserdata/RP.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/xcuserdata/RP.xcuserdatad/xcschemes/ValidateIt.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/xcuserdata/RP.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ValidateIt.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F0729F201898694A00886CF3 16 | 17 | primary 18 | 19 | 20 | F0729F411898694A00886CF3 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/xcuserdata/sepodermardirousian.xcuserdatad/xcschemes/ValidateIt.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/ValidateIt.xcodeproj/xcuserdata/sepodermardirousian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ValidateIt.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F0729F201898694A00886CF3 16 | 17 | primary 18 | 19 | 20 | F0729F411898694A00886CF3 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/ValidateIt/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/ValidateIt/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application 19 | { 20 | } 21 | 22 | - (void)applicationDidEnterBackground:(UIApplication *)application 23 | { 24 | } 25 | 26 | - (void)applicationWillEnterForeground:(UIApplication *)application 27 | { 28 | } 29 | 30 | - (void)applicationDidBecomeActive:(UIApplication *)application 31 | { 32 | } 33 | 34 | - (void)applicationWillTerminate:(UIApplication *)application 35 | { 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/ValidateIt/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Example/ValidateIt/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ValidateIt/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ValidateIt/ValidateIt-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com..${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/ValidateIt/ValidateIt-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/ValidateIt/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "validation.h" 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | - (IBAction)validateMe:(id)sender; 16 | 17 | @property (weak, nonatomic) IBOutlet UITextField *email; 18 | @property (weak, nonatomic) IBOutlet UITextField *password; 19 | @property (weak, nonatomic) IBOutlet UIView *errorView; 20 | @property (weak, nonatomic) IBOutlet UILabel *errorLabel; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/ValidateIt/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | self.errorLabel.hidden = TRUE; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | } 27 | 28 | - (IBAction)validateMe:(id)sender { 29 | 30 | //====== Initialize The Validation Library 31 | validation *validate=[[validation alloc] init]; 32 | 33 | //====== Pass In the textField and desired textFieldName for each validation method 34 | [validate Email:self.email.text FieldName:@"Email Address"]; 35 | [validate Required:self.email.text FieldName:@"Email Address"]; 36 | [validate Required:self.password.text FieldName:@"Password"]; 37 | [validate MaxLength:12 textField:self.password.text FieldName:@"User Password"]; 38 | 39 | //===== Check If Text Fields Are Valid Or Not ========// 40 | if([validate isValid] == TRUE){ 41 | NSLog(@"Everything is Okay"); 42 | self.errorLabel.hidden = TRUE; 43 | }else{ 44 | //=========== Show Error Messages From errorMsg Array ===============// 45 | NSLog(@"Error Messages From Clinet Side: %@",[validate errorMsg]); 46 | NSLog(@"Oops ! :( there is an error in the system"); 47 | NSString *errorString = [[validate errorMsg] componentsJoinedByString: @"\n"]; 48 | self.errorLabel.hidden = FALSE; 49 | self.errorLabel.numberOfLines = 0; 50 | [self.errorLabel sizeToFit]; 51 | self.errorLabel.text = errorString; 52 | } 53 | 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/ValidateIt/correct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arpi6/validateIt/9d7eed98807abe62109b35937b3fbacd29aee286/Example/ValidateIt/correct.png -------------------------------------------------------------------------------- /Example/ValidateIt/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ValidateIt/incorrect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arpi6/validateIt/9d7eed98807abe62109b35937b3fbacd29aee286/Example/ValidateIt/incorrect.png -------------------------------------------------------------------------------- /Example/ValidateIt/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ValidateIt/validation.h: -------------------------------------------------------------------------------- 1 | // 2 | // validation.h 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/27/14. 6 | // Copyright (c) 2014 Arpi Dermardirousian. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface validation : NSObject { 12 | } 13 | 14 | - (void) Email : (NSString *) emailAddress FieldName: (NSString *) textFieldName; 15 | - (void) Required : (NSString *) textField FieldName: (NSString *) textFieldName; 16 | - (void) MinLength: (NSInteger ) length textFiled: (NSString *) textField FieldName: (NSString *) textFieldName; 17 | - (void) LettersSpaceOnly: (NSString *) textField FieldName: (NSString *) textFieldName; 18 | - (void) MaxLength: (NSInteger) length textField: (NSString *)textField FieldName: (NSString *) textFieldName; 19 | 20 | - (BOOL) isValid; 21 | 22 | @property(nonatomic) UIButton* submissionButton; 23 | @property(nonatomic, strong) NSMutableArray * errors; 24 | @property(nonatomic, strong) NSMutableArray * errorMsg; 25 | @property(nonatomic, strong) NSMutableArray * emailError; 26 | @property(nonatomic, strong) NSMutableArray * requiredError; 27 | @property(nonatomic, strong) NSMutableArray *minLengthError; 28 | @property(nonatomic, strong) NSMutableArray *lettersSpaceOnly; 29 | @property(nonatomic, strong) NSMutableArray *maxLengthError; 30 | 31 | @property(nonatomic, strong) NSMutableArray * emailErrorMsg; 32 | @property(nonatomic, strong) NSMutableArray * requiredErrorMsg; 33 | @property(nonatomic, strong) NSMutableArray *minLengthErrorMsg; 34 | @property(nonatomic, strong) NSMutableArray *lettersSpaceOnlyMsg; 35 | @property(nonatomic, strong) NSMutableArray *maxLengthErrorMsg; 36 | @property(nonatomic, strong) NSString *errorStr; 37 | @property(nonatomic) BOOL textFiledIsValid; 38 | 39 | @property(nonatomic, strong) NSString *textField; 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/ValidateIt/validation.m: -------------------------------------------------------------------------------- 1 | // 2 | // validation.m 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/27/14. 6 | // Copyright (c) 2014 Arpi Dermardirousian. All rights reserved. 7 | // 8 | 9 | #import "validation.h" 10 | 11 | @implementation validation 12 | 13 | - (id)init { 14 | self = [super init]; 15 | if (self) { 16 | self.errorMsg = [[NSMutableArray alloc]init]; 17 | self.requiredErrorMsg = [[NSMutableArray alloc]init]; 18 | self.emailErrorMsg = [[NSMutableArray alloc]init]; 19 | self.lettersSpaceOnlyMsg = [[NSMutableArray alloc]init]; 20 | self.maxLengthErrorMsg = [[NSMutableArray alloc]init]; 21 | self.minLengthErrorMsg = [[NSMutableArray alloc]init]; 22 | self.requiredError = [[NSMutableArray alloc]initWithObjects:@"1", nil]; 23 | 24 | self.maxLengthError = [NSMutableArray arrayWithObjects:@"1", nil]; 25 | self.minLengthError = [NSMutableArray arrayWithObjects:@"1", nil]; 26 | self.lettersSpaceOnly = [NSMutableArray arrayWithObjects:@"1", nil]; 27 | self.emailError = [NSMutableArray arrayWithObjects:@"1",nil]; 28 | 29 | } 30 | return self; 31 | } 32 | 33 | //=========== Email Address ========// 34 | -(void) Email: (NSString *) emailAddress FieldName: (NSString *) textFieldName{ 35 | 36 | if(emailAddress.length > 0){ 37 | NSString *emailRegEx = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 38 | NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx]; 39 | NSString *msg = @"Email address is invalid."; 40 | if ([emailTest evaluateWithObject:emailAddress] == NO) { 41 | [self.emailError replaceObjectAtIndex:0 withObject:@"1"]; 42 | [self.emailErrorMsg addObject:msg]; 43 | return; 44 | }else{ 45 | [self.emailError replaceObjectAtIndex:0 withObject:@"0"]; 46 | return; 47 | } 48 | } 49 | } 50 | 51 | //=========== Letters And Space Only ========// 52 | -(void) LettersSpaceOnly: (NSString *) textField FieldName: (NSString *) textFieldName { 53 | 54 | NSString *lettersSpaceRegex = @"[a-zA-z]+([ '-][a-zA-Z]+)*$"; 55 | NSPredicate *lettersSpaceTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", lettersSpaceRegex]; 56 | if(textField.length > 0){ 57 | if([lettersSpaceTest evaluateWithObject:textField] == NO){ 58 | [self.lettersSpaceOnly replaceObjectAtIndex:0 withObject:@"1"]; 59 | NSString *msg = [NSString stringWithFormat:@"%@%s",textFieldName," should contain letters and space only."]; 60 | [self.lettersSpaceOnlyMsg addObject:msg]; 61 | return; 62 | }else{ 63 | [self.lettersSpaceOnly replaceObjectAtIndex:0 withObject:@"0"]; 64 | return; 65 | } 66 | } 67 | } 68 | 69 | //=========== Required ========// 70 | -(void) Required: (NSString *) textField FieldName: (NSString *) textFieldName { 71 | 72 | if ([textField isEqualToString:@""]) { 73 | [self.requiredError replaceObjectAtIndex:0 withObject:@"1"]; 74 | NSString *msg = [NSString stringWithFormat:@"%@%s",textFieldName, " is required."]; 75 | [self.requiredErrorMsg addObject:msg]; 76 | return; 77 | } 78 | else 79 | { 80 | [self.requiredError replaceObjectAtIndex:0 withObject:@"0"]; 81 | return; 82 | } 83 | } 84 | 85 | //=========== MinLength ========// 86 | -(void) MinLength: (NSInteger) length textFiled: (NSString *)textField FieldName: (NSString *) textFieldName{ 87 | 88 | 89 | if(textField.length > length || textField.length == length){ 90 | [self.minLengthError replaceObjectAtIndex:0 withObject:@"0"]; 91 | return ; 92 | }else{ 93 | [self.minLengthError replaceObjectAtIndex:0 withObject:@"1"]; 94 | NSString *msg = [NSString stringWithFormat:@"%@%s%i%s",textFieldName," should have minimum of ", length , " characters."]; 95 | [self.minLengthErrorMsg addObject:msg]; 96 | return; 97 | } 98 | } 99 | 100 | //=========== MaxLength ========// 101 | -(void) MaxLength: (NSInteger) length textField: (NSString *)textField FieldName: (NSString *) textFieldName { 102 | 103 | if(textField.length < length || textField.length == length) { 104 | [self.maxLengthError replaceObjectAtIndex:0 withObject:@"0"]; 105 | return; 106 | }else{ 107 | [self.maxLengthError replaceObjectAtIndex:0 withObject:@"1"]; 108 | NSString *msg = [NSString stringWithFormat:@"%@%s%i%s",textFieldName," should have maximum of ", length , " characters."]; 109 | [self.maxLengthErrorMsg addObject:msg]; 110 | } 111 | } 112 | 113 | 114 | //=========== Check If TextFields Are Valid ========// 115 | 116 | -(BOOL) isValid { 117 | 118 | self.errors = [NSMutableArray arrayWithObjects:@"0",@"0",@"0",@"0",@"0", nil]; 119 | 120 | if(self.emailErrorMsg.count > 0){ 121 | for(NSString *emMsg in self.emailErrorMsg){ 122 | [self.errorMsg addObject:emMsg]; 123 | [self.errors replaceObjectAtIndex:0 withObject:@"1"]; 124 | } 125 | }else{ 126 | [self.errors replaceObjectAtIndex:0 withObject:@"0"]; 127 | } 128 | 129 | if(self.requiredErrorMsg.count > 0){ 130 | for(NSString *msg in self.requiredErrorMsg){ 131 | [self.errorMsg addObject:msg]; 132 | [self.errors replaceObjectAtIndex:1 withObject:@"1"]; 133 | } 134 | }else{ 135 | [self.errors replaceObjectAtIndex:1 withObject:@"0"]; 136 | } 137 | 138 | if(self.minLengthErrorMsg.count > 0){ 139 | for(NSString *minMsg in self.minLengthErrorMsg){ 140 | [self.errors replaceObjectAtIndex:2 withObject:@"1"]; 141 | [self.errorMsg addObject:minMsg]; 142 | } 143 | }else{ 144 | [self.errors replaceObjectAtIndex:2 withObject:@"0"]; 145 | } 146 | 147 | if(self.lettersSpaceOnlyMsg.count > 0 ){ 148 | for (NSString *ltMsg in self.lettersSpaceOnlyMsg) { 149 | [self.errorMsg addObject:ltMsg]; 150 | [self.errors replaceObjectAtIndex:3 withObject:@"1"]; 151 | } 152 | }else{ 153 | [self.errors replaceObjectAtIndex:3 withObject:@"0"]; 154 | } 155 | 156 | if(self.maxLengthErrorMsg.count > 0){ 157 | for(NSString *maxMsg in self.maxLengthErrorMsg){ 158 | [self.errorMsg addObject:maxMsg]; 159 | [self.errors replaceObjectAtIndex:4 withObject:@"1"]; 160 | } 161 | 162 | }else{ 163 | [self.errors replaceObjectAtIndex:4 withObject:@"0"]; 164 | } 165 | 166 | 167 | for (NSString *item in self.errors) { 168 | if([[self.errors objectAtIndex:1]isEqualToString:@"1"] || [[self.errors objectAtIndex:2]isEqualToString:@"1"] || [[self.errors objectAtIndex:0]isEqualToString:@"1"] || [[self.errors objectAtIndex:3]isEqualToString:@"1"] || [[self.errors objectAtIndex:4]isEqualToString:@"1"]){ 169 | self.textFiledIsValid = FALSE; 170 | NSLog(@"Not Valid %hhi",self.textFiledIsValid); 171 | }else{ 172 | self.textFiledIsValid = TRUE; 173 | NSLog(@"Valid %hhi",self.textFiledIsValid); 174 | } 175 | } 176 | 177 | return self.textFiledIsValid; 178 | } 179 | 180 | 181 | @end -------------------------------------------------------------------------------- /Example/ValidateItTests/ValidateItTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com..${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/ValidateItTests/ValidateItTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ValidateItTests.m 3 | // ValidateItTests 4 | // 5 | // Created by Arpi Dermardirousian on 1/28/14. 6 | // Copyright (c) 2014 ValidateIt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ValidateItTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ValidateItTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/ValidateItTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Arpi Dermardirousian 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | validateIt 2 | ========== 3 | 4 | Validation Library for IOS apps 5 | 6 | 7 | 8 | ## Options 9 | Validation for:
10 | email address,
11 | required text field,
12 | minimum length,
13 | maximum length,
14 | letters and space only. 15 | 16 | ## Examples 17 | 18 | ```objc 19 | //====== Initialize The Validation Library 20 | validation *validate=[[validation alloc] init]; 21 | 22 | //====== Pass In the textField and desired textFieldName for each validation method 23 | [validate Email:self.email FieldName:@"Email Address"]; 24 | [validate Required:self.email FieldName:@"Email Address"]; 25 | [validate Required:self.password FieldName:@"Password"]; 26 | [validate MaxLength:12 textField:self.password FieldName:@"User Password"]; 27 | [validate isValid]; 28 | ``` 29 | ## Usage 30 | 31 | Check out the xCode sample project for this validation plugin. 32 | 33 | ## Contact 34 | 35 | Email : arpiderm@gmail.com 36 | -------------------------------------------------------------------------------- /ValidateIt Library/validation.h: -------------------------------------------------------------------------------- 1 | // 2 | // validation.h 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/27/14. 6 | // Copyright (c) 2014 Arpi Dermardirousian. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface validation : NSObject { 12 | } 13 | 14 | - (void) Email : (NSString *) emailAddress FieldName: (NSString *) textFieldName; 15 | - (void) Required : (NSString *) textField FieldName: (NSString *) textFieldName; 16 | - (void) MinLength: (NSInteger ) length textFiled: (NSString *) textField FieldName: (NSString *) textFieldName; 17 | - (void) LettersSpaceOnly: (NSString *) textField FieldName: (NSString *) textFieldName; 18 | - (void) MaxLength: (NSInteger) length textField: (NSString *)textField FieldName: (NSString *) textFieldName; 19 | 20 | - (BOOL) isValid; 21 | 22 | @property(nonatomic) UIButton* submissionButton; 23 | @property(nonatomic, strong) NSMutableArray * errors; 24 | @property(nonatomic, strong) NSMutableArray * errorMsg; 25 | @property(nonatomic, strong) NSMutableArray * emailError; 26 | @property(nonatomic, strong) NSMutableArray * requiredError; 27 | @property(nonatomic, strong) NSMutableArray *minLengthError; 28 | @property(nonatomic, strong) NSMutableArray *lettersSpaceOnly; 29 | @property(nonatomic, strong) NSMutableArray *maxLengthError; 30 | 31 | @property(nonatomic, strong) NSMutableArray * emailErrorMsg; 32 | @property(nonatomic, strong) NSMutableArray * requiredErrorMsg; 33 | @property(nonatomic, strong) NSMutableArray *minLengthErrorMsg; 34 | @property(nonatomic, strong) NSMutableArray *lettersSpaceOnlyMsg; 35 | @property(nonatomic, strong) NSMutableArray *maxLengthErrorMsg; 36 | @property(nonatomic, strong) NSString *errorStr; 37 | @property(nonatomic) BOOL textFiledIsValid; 38 | 39 | @property(nonatomic, strong) NSString *textField; 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /ValidateIt Library/validation.m: -------------------------------------------------------------------------------- 1 | // 2 | // validation.m 3 | // ValidateIt 4 | // 5 | // Created by Arpi Dermardirousian on 1/27/14. 6 | // Copyright (c) 2014 Arpi Dermardirousian. All rights reserved. 7 | // 8 | 9 | #import "validation.h" 10 | 11 | @implementation validation 12 | 13 | - (id)init { 14 | self = [super init]; 15 | if (self) { 16 | self.errorMsg = [[NSMutableArray alloc]init]; 17 | self.requiredErrorMsg = [[NSMutableArray alloc]init]; 18 | self.emailErrorMsg = [[NSMutableArray alloc]init]; 19 | self.lettersSpaceOnlyMsg = [[NSMutableArray alloc]init]; 20 | self.maxLengthErrorMsg = [[NSMutableArray alloc]init]; 21 | self.minLengthErrorMsg = [[NSMutableArray alloc]init]; 22 | self.requiredError = [[NSMutableArray alloc]initWithObjects:@"1", nil]; 23 | 24 | self.maxLengthError = [NSMutableArray arrayWithObjects:@"1", nil]; 25 | self.minLengthError = [NSMutableArray arrayWithObjects:@"1", nil]; 26 | self.lettersSpaceOnly = [NSMutableArray arrayWithObjects:@"1", nil]; 27 | self.emailError = [NSMutableArray arrayWithObjects:@"1",nil]; 28 | 29 | } 30 | return self; 31 | } 32 | 33 | //=========== Email Address ========// 34 | -(void) Email: (NSString *) emailAddress FieldName: (NSString *) textFieldName{ 35 | 36 | if(emailAddress.length > 0){ 37 | NSString *emailRegEx = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 38 | NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx]; 39 | NSString *msg = @"Email address is invalid."; 40 | if ([emailTest evaluateWithObject:emailAddress] == NO) { 41 | [self.emailError replaceObjectAtIndex:0 withObject:@"1"]; 42 | [self.emailErrorMsg addObject:msg]; 43 | return; 44 | }else{ 45 | [self.emailError replaceObjectAtIndex:0 withObject:@"0"]; 46 | return; 47 | } 48 | } 49 | } 50 | 51 | //=========== Letters And Space Only ========// 52 | -(void) LettersSpaceOnly: (NSString *) textField FieldName: (NSString *) textFieldName { 53 | 54 | NSString *lettersSpaceRegex = @"[a-zA-z]+([ '-][a-zA-Z]+)*$"; 55 | NSPredicate *lettersSpaceTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", lettersSpaceRegex]; 56 | if(textField.length > 0){ 57 | if([lettersSpaceTest evaluateWithObject:textField] == NO){ 58 | [self.lettersSpaceOnly replaceObjectAtIndex:0 withObject:@"1"]; 59 | NSString *msg = [NSString stringWithFormat:@"%@%s",textFieldName," should contain letters and space only."]; 60 | [self.lettersSpaceOnlyMsg addObject:msg]; 61 | return; 62 | }else{ 63 | [self.lettersSpaceOnly replaceObjectAtIndex:0 withObject:@"0"]; 64 | return; 65 | } 66 | } 67 | } 68 | 69 | //=========== Required ========// 70 | -(void) Required: (NSString *) textField FieldName: (NSString *) textFieldName { 71 | 72 | if ([textField isEqualToString:@""]) { 73 | [self.requiredError replaceObjectAtIndex:0 withObject:@"1"]; 74 | NSString *msg = [NSString stringWithFormat:@"%@%s",textFieldName, " is required."]; 75 | [self.requiredErrorMsg addObject:msg]; 76 | return; 77 | } 78 | else 79 | { 80 | [self.requiredError replaceObjectAtIndex:0 withObject:@"0"]; 81 | return; 82 | } 83 | } 84 | 85 | //=========== MinLength ========// 86 | -(void) MinLength: (NSInteger) length textFiled: (NSString *)textField FieldName: (NSString *) textFieldName{ 87 | 88 | 89 | if(textField.length > length || textField.length == length){ 90 | [self.minLengthError replaceObjectAtIndex:0 withObject:@"0"]; 91 | return ; 92 | }else{ 93 | [self.minLengthError replaceObjectAtIndex:0 withObject:@"1"]; 94 | NSString *msg = [NSString stringWithFormat:@"%@%s%i%s",textFieldName," should have minimum of ", length , " characters."]; 95 | [self.minLengthErrorMsg addObject:msg]; 96 | return; 97 | } 98 | } 99 | 100 | //=========== MaxLength ========// 101 | -(void) MaxLength: (NSInteger) length textField: (NSString *)textField FieldName: (NSString *) textFieldName { 102 | 103 | if(textField.length < length || textField.length == length) { 104 | [self.maxLengthError replaceObjectAtIndex:0 withObject:@"0"]; 105 | return; 106 | }else{ 107 | [self.maxLengthError replaceObjectAtIndex:0 withObject:@"1"]; 108 | NSString *msg = [NSString stringWithFormat:@"%@%s%i%s",textFieldName," should have maximum of ", length , " characters."]; 109 | [self.maxLengthErrorMsg addObject:msg]; 110 | } 111 | } 112 | 113 | 114 | //=========== Check If TextFields Are Valid ========// 115 | 116 | -(BOOL) isValid { 117 | 118 | self.errors = [NSMutableArray arrayWithObjects:@"0",@"0",@"0",@"0",@"0", nil]; 119 | 120 | if(self.emailErrorMsg.count > 0){ 121 | for(NSString *emMsg in self.emailErrorMsg){ 122 | [self.errorMsg addObject:emMsg]; 123 | [self.errors replaceObjectAtIndex:0 withObject:@"1"]; 124 | } 125 | }else{ 126 | [self.errors replaceObjectAtIndex:0 withObject:@"0"]; 127 | } 128 | 129 | if(self.requiredErrorMsg.count > 0){ 130 | for(NSString *msg in self.requiredErrorMsg){ 131 | [self.errorMsg addObject:msg]; 132 | [self.errors replaceObjectAtIndex:1 withObject:@"1"]; 133 | } 134 | }else{ 135 | [self.errors replaceObjectAtIndex:1 withObject:@"0"]; 136 | } 137 | 138 | if(self.minLengthErrorMsg.count > 0){ 139 | for(NSString *minMsg in self.minLengthErrorMsg){ 140 | [self.errors replaceObjectAtIndex:2 withObject:@"1"]; 141 | [self.errorMsg addObject:minMsg]; 142 | } 143 | }else{ 144 | [self.errors replaceObjectAtIndex:2 withObject:@"0"]; 145 | } 146 | 147 | if(self.lettersSpaceOnlyMsg.count > 0 ){ 148 | for (NSString *ltMsg in self.lettersSpaceOnlyMsg) { 149 | [self.errorMsg addObject:ltMsg]; 150 | [self.errors replaceObjectAtIndex:3 withObject:@"1"]; 151 | } 152 | }else{ 153 | [self.errors replaceObjectAtIndex:3 withObject:@"0"]; 154 | } 155 | 156 | if(self.maxLengthErrorMsg.count > 0){ 157 | for(NSString *maxMsg in self.maxLengthErrorMsg){ 158 | [self.errorMsg addObject:maxMsg]; 159 | [self.errors replaceObjectAtIndex:4 withObject:@"1"]; 160 | } 161 | 162 | }else{ 163 | [self.errors replaceObjectAtIndex:4 withObject:@"0"]; 164 | } 165 | 166 | 167 | for (NSString *item in self.errors) { 168 | if([[self.errors objectAtIndex:1]isEqualToString:@"1"] || [[self.errors objectAtIndex:2]isEqualToString:@"1"] || [[self.errors objectAtIndex:0]isEqualToString:@"1"] || [[self.errors objectAtIndex:3]isEqualToString:@"1"] || [[self.errors objectAtIndex:4]isEqualToString:@"1"]){ 169 | self.textFiledIsValid = FALSE; 170 | NSLog(@"Not Valid %hhi",self.textFiledIsValid); 171 | }else{ 172 | self.textFiledIsValid = TRUE; 173 | NSLog(@"Valid %hhi",self.textFiledIsValid); 174 | } 175 | } 176 | 177 | return self.textFiledIsValid; 178 | } 179 | 180 | 181 | @end --------------------------------------------------------------------------------