├── TextFieldValidator
├── error@2x.png
├── TextFieldValidator.h
└── TextFieldValidator.m
├── TextFieldValidationDemo
├── TextFieldValidationDemoTests
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── TextFieldValidationDemoTests-Info.plist
│ └── TextFieldValidationDemoTests.m
├── TextFieldValidationDemo
│ ├── Supporting Files
│ │ ├── en.lproj
│ │ │ └── InfoPlist.strings
│ │ ├── TextFieldValidationDemo-Prefix.pch
│ │ ├── TextFieldValidationDemo-Info.plist
│ │ └── Base.lproj
│ │ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ ├── error.imageset
│ │ │ ├── error.png
│ │ │ ├── error@2x.png
│ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ └── Classes
│ │ ├── FormViewController
│ │ ├── ViewController.h
│ │ └── ViewController.m
│ │ ├── SecondViewController
│ │ ├── SecondViewController.h
│ │ └── SecondViewController.m
│ │ ├── AppDelegate
│ │ ├── AppDelegate.h
│ │ └── AppDelegate.m
│ │ ├── main.m
│ │ └── TextFieldValidator
│ │ ├── TextFieldValidator.h
│ │ └── TextFieldValidator.m
└── TextFieldValidationDemo.xcodeproj
│ ├── xcuserdata
│ └── dhawaldawar.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── TextFieldValidationDemo.xcscheme
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── dhawaldawar.xcuserdatad
│ │ │ ├── UserInterfaceState.xcuserstate
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── TextFieldValidationDemo.xccheckout
│ └── project.pbxproj
├── README.md
└── LICENSE.md
/TextFieldValidator/error@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhawaldawar/TextFieldValidator/HEAD/TextFieldValidator/error@2x.png
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemoTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Supporting Files/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/xcuserdata/dhawaldawar.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Images.xcassets/error.imageset/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhawaldawar/TextFieldValidator/HEAD/TextFieldValidationDemo/TextFieldValidationDemo/Images.xcassets/error.imageset/error.png
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Images.xcassets/error.imageset/error@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhawaldawar/TextFieldValidator/HEAD/TextFieldValidationDemo/TextFieldValidationDemo/Images.xcassets/error.imageset/error@2x.png
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | TextFieldValidator
2 | ==================
3 | A lightweight, customizable subclass of UITextField that supports multiple regex validations and provides a simple UI to provide validation feedback.
4 |
5 | See the original blog post for details: https://dhawaldawar.wordpress.com/2014/06/11/uitextfield-validation-ios/
6 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace/xcuserdata/dhawaldawar.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhawaldawar/TextFieldValidator/HEAD/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace/xcuserdata/dhawaldawar.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/FormViewController/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController{
12 |
13 | }
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/SecondViewController/SecondViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.h
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SecondViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/AppDelegate/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Images.xcassets/error.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x",
6 | "filename" : "error.png"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x",
11 | "filename" : "error@2x.png"
12 | }
13 | ],
14 | "info" : {
15 | "version" : 1,
16 | "author" : "xcode"
17 | }
18 | }
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. 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 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace/xcuserdata/dhawaldawar.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-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 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/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 | }
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/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 | }
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/xcuserdata/dhawaldawar.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | TextFieldValidationDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 6C26527F194080A300948579
16 |
17 | primary
18 |
19 |
20 | 6C2652A0194080A300948579
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemoTests/TextFieldValidationDemoTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | test.${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 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemoTests/TextFieldValidationDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // TextFieldValidationDemoTests.m
3 | // TextFieldValidationDemoTests
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TextFieldValidationDemoTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation TextFieldValidationDemoTests
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 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | **The MIT License (MIT)**
2 |
3 | Copyright (c) 2014 *!!Dhawal Dawar!!*
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | test.${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 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/SecondViewController/SecondViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.m
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import "SecondViewController.h"
10 |
11 | @interface SecondViewController ()
12 |
13 | @end
14 |
15 | @implementation SecondViewController
16 |
17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
18 | {
19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
20 | if (self) {
21 | // Custom initialization
22 | }
23 | return self;
24 | }
25 |
26 | - (void)viewDidLoad
27 | {
28 | [super viewDidLoad];
29 | // Do any additional setup after loading the view.
30 | }
31 |
32 | - (void)didReceiveMemoryWarning
33 | {
34 | [super didReceiveMemoryWarning];
35 | // Dispose of any resources that can be recreated.
36 | }
37 |
38 | /*
39 | #pragma mark - Navigation
40 |
41 | // In a storyboard-based application, you will often want to do a little preparation before navigation
42 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
43 | {
44 | // Get the new view controller using [segue destinationViewController].
45 | // Pass the selected object to the new view controller.
46 | }
47 | */
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace/xcshareddata/TextFieldValidationDemo.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 16F95ED0-8451-4514-A5FB-B71ED1FF2499
9 | IDESourceControlProjectName
10 | TextFieldValidationDemo
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | D3169203-2ECA-471E-B061-7B1B06B5374B
14 | https://github.com/dhawaldawar/TextFieldValidator.git
15 |
16 | IDESourceControlProjectPath
17 | TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.xcworkspace
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | D3169203-2ECA-471E-B061-7B1B06B5374B
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/dhawaldawar/TextFieldValidator.git
25 | IDESourceControlProjectVersion
26 | 110
27 | IDESourceControlProjectWCCIdentifier
28 | D3169203-2ECA-471E-B061-7B1B06B5374B
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | D3169203-2ECA-471E-B061-7B1B06B5374B
36 | IDESourceControlWCCName
37 | TextFieldValidator
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/AppDelegate/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @implementation AppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // 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.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // 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.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // 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.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/FormViewController/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // TextFieldValidationDemo
4 | //
5 | // Created by Dhawal.Dawar on 05/06/14.
6 | // Copyright (c) 2014 Dhawal.Dawar. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "TextFieldValidator.h"
11 | #import "SecondViewController.h"
12 |
13 | #define REGEX_USER_NAME_LIMIT @"^.{3,10}$"
14 | #define REGEX_USER_NAME @"[A-Za-z0-9]{3,10}"
15 | #define REGEX_EMAIL @"[A-Z0-9a-z._%+-]{3,}+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
16 | #define REGEX_PASSWORD_LIMIT @"^.{6,20}$"
17 | #define REGEX_PASSWORD @"[A-Za-z0-9]{6,20}"
18 | #define REGEX_PHONE_DEFAULT @"[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}"
19 |
20 | @interface ViewController (){
21 | IBOutlet TextFieldValidator *txtUserName;
22 | IBOutlet TextFieldValidator *txtEmail;
23 | IBOutlet TextFieldValidator *txtPassword;
24 | IBOutlet TextFieldValidator *txtConfirmPass;
25 | IBOutlet TextFieldValidator *txtPhone;
26 | TextFieldValidator *txtDemo;
27 |
28 | SecondViewController *secondViewController;
29 |
30 | IBOutlet UIView *viewContainer;
31 | IBOutlet UIScrollView *scrlView;
32 | }
33 | - (IBAction)btnSubmit:(id)sender;
34 |
35 | @end
36 |
37 | @implementation ViewController
38 |
39 | - (void)viewDidLoad
40 | {
41 | [super viewDidLoad];
42 | // Do any additional setup after loading the view, typically from a nib.
43 | [self setupAlerts];
44 |
45 | txtDemo=[[TextFieldValidator alloc] initWithFrame:CGRectMake(20, 200, 280, 30)];
46 | txtDemo.borderStyle=UITextBorderStyleRoundedRect;
47 | txtDemo.placeholder=@"Programmatically created - Email";
48 | txtDemo.delegate=self;
49 | txtDemo.presentInView=self.view;
50 | [viewContainer addSubview:txtDemo];
51 | [txtDemo addRegx:REGEX_EMAIL withMsg:@"Enter valid email."];
52 | }
53 |
54 | -(void)setupAlerts{
55 | [txtUserName addRegx:REGEX_USER_NAME_LIMIT withMsg:@"User name charaters limit should be come between 3-10"];
56 | [txtUserName addRegx:REGEX_USER_NAME withMsg:@"Only alpha numeric characters are allowed."];
57 | txtUserName.validateOnResign=NO;
58 |
59 | [txtEmail addRegx:REGEX_EMAIL withMsg:@"Enter valid email."];
60 |
61 | [txtPassword addRegx:REGEX_PASSWORD_LIMIT withMsg:@"Password characters limit should be come between 6-20"];
62 | [txtPassword addRegx:REGEX_PASSWORD withMsg:@"Password must contain alpha numeric characters."];
63 |
64 | [txtConfirmPass addConfirmValidationTo:txtPassword withMsg:@"Confirm password didn't match."];
65 |
66 | [txtPhone addRegx:REGEX_PHONE_DEFAULT withMsg:@"Phone number must be in proper format (eg. ###-###-####)"];
67 | txtPhone.isMandatory=NO;
68 | }
69 |
70 | - (void)didReceiveMemoryWarning
71 | {
72 | [super didReceiveMemoryWarning];
73 | // Dispose of any resources that can be recreated.
74 | }
75 |
76 | - (IBAction)btnSubmit:(id)sender {
77 | if([txtUserName validate] & [txtEmail validate] & [txtPassword validate] & [txtConfirmPass validate] & [txtPhone validate] & [txtDemo validate]){
78 | secondViewController=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SecondViewController"];
79 | [self.navigationController pushViewController:secondViewController animated:YES];
80 | }
81 | }
82 |
83 | #pragma mark - UITextFieldDelegate
84 | - (void)textFieldDidBeginEditing:(UITextField *)textField{
85 | if(txtDemo==textField){
86 | [scrlView setContentOffset:CGPointMake(0, 50) animated:YES];
87 | }
88 | }
89 |
90 | - (BOOL)textFieldShouldReturn:(UITextField *)textField{
91 | [textField resignFirstResponder];
92 | return YES;
93 | }
94 |
95 | @end
96 |
--------------------------------------------------------------------------------
/TextFieldValidator/TextFieldValidator.h:
--------------------------------------------------------------------------------
1 | //
2 | // TextFieldValidator.h
3 | // Textfield Validation Handler
4 | //
5 | // Created by Dhawal Dawar on 10/06/2014.
6 | // Copyright (c) 2014 Dhawal Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | Image name for showing error on textfield.
13 | */
14 | #define IconImageName @"error.png"
15 |
16 | /**
17 | Background color of message popup.
18 | */
19 | #define ColorPopUpBg [UIColor colorWithRed:0.702 green:0.000 blue:0.000 alpha:1.000]
20 |
21 | /**
22 | Font color of the message.
23 | */
24 | #define ColorFont [UIColor whiteColor]
25 |
26 | /**
27 | Font size of the message.
28 | */
29 | #define FontSize 15
30 |
31 | /**
32 | Font style name of the message.
33 | */
34 | #define FontName @"Helvetica-Bold"
35 |
36 | /**
37 | Padding in pixels for the popup.
38 | */
39 | #define PaddingInErrorPopUp 5
40 |
41 | /**
42 | Default message for validating length, you can also assign message separately using method 'updateLengthValidationMsg:' for textfields.
43 | */
44 | #define MsgValidateLength @"This field cannot be blank"
45 |
46 |
47 | /**
48 | TextFieldValidator is the inherited class of UITextField for performing validation effectively. This class will handle all kind of validations with just few lines of code using regex and it is fully customisable. You can easily port this functionality in your existing code as well, you just need to change class name from UITextField to TextFieldValidator and apply regex for performing validation.
49 | */
50 | NS_CLASS_AVAILABLE_IOS(6_0) @interface TextFieldValidator : UITextField{
51 |
52 | }
53 |
54 | @property (nonatomic,assign) BOOL isMandatory; /**< Default is YES*/
55 |
56 | @property (nonatomic,retain) IBOutlet UIView *presentInView; /**< Assign view on which you want to show popup and it would be good if you provide controller's view*/
57 |
58 | @property (nonatomic,retain) UIColor *popUpColor; /**< Assign popup background color, you can also assign default popup color from macro "ColorPopUpBg" at the top*/
59 |
60 | @property (nonatomic,assign) BOOL validateOnCharacterChanged; /**< Default is YES, Use it whether you want to validate text on character change or not.*/
61 |
62 | @property (nonatomic,assign) BOOL validateOnResign; /**< Default is YES, Use it whether you want to validate text on resign or not.*/
63 |
64 | /**
65 | Use to add regex for validating textfield text, you need to specify all your regex in queue that you want to validate and their messages respectively that will show when any regex validation will fail.
66 | @param strRegx Regex string
67 | @param msg Message string to be displayed when given regex will fail.
68 | */
69 | -(void)addRegx:(NSString *)strRegx withMsg:(NSString *)msg;
70 |
71 | /**
72 | By deafult the message will be shown which is given in the macro "MsgValidateLength", but you can change message for each textfield as well.
73 | @param msg Message string to be displayed when length validation will fail.
74 | */
75 | -(void)updateLengthValidationMsg:(NSString *)msg;
76 |
77 | /**
78 | Use to add validation for validating confirm password
79 | @param txtPassword Hold reference of password textfield from which they will check text equality.
80 | */
81 | -(void)addConfirmValidationTo:(TextFieldValidator *)txtPassword withMsg:(NSString *)msg;
82 |
83 | /**
84 | Use to perform validation
85 | @return Bool It will return YES if all provided regex validation will pass else return NO
86 |
87 | Eg: If you want to apply validation on all fields simultaneously then refer below code which will be make it easy to handle validations
88 | if([txtField1 validate] & [txtField2 validate]){
89 | // Success operation
90 | }
91 | */
92 | -(BOOL)validate;
93 |
94 | /**
95 | Use to dismiss error popup.
96 | */
97 | -(void)dismissPopup;
98 |
99 | @end
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/TextFieldValidator/TextFieldValidator.h:
--------------------------------------------------------------------------------
1 | //
2 | // TextFieldValidator.h
3 | // Textfield Validation Handler
4 | //
5 | // Created by Dhawal Dawar on 10/06/2014.
6 | // Copyright (c) 2014 Dhawal Dawar. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | Image name for showing error on textfield.
13 | */
14 | #define IconImageName @"error.png"
15 |
16 | /**
17 | Background color of message popup.
18 | */
19 | #define ColorPopUpBg [UIColor colorWithRed:0.702 green:0.000 blue:0.000 alpha:1.000]
20 |
21 | /**
22 | Font color of the message.
23 | */
24 | #define ColorFont [UIColor whiteColor]
25 |
26 | /**
27 | Font size of the message.
28 | */
29 | #define FontSize 15
30 |
31 | /**
32 | Font style name of the message.
33 | */
34 | #define FontName @"Helvetica-Bold"
35 |
36 | /**
37 | Padding in pixels for the popup.
38 | */
39 | #define PaddingInErrorPopUp 5
40 |
41 | /**
42 | Default message for validating length, you can also assign message separately using method 'updateLengthValidationMsg:' for textfields.
43 | */
44 | #define MsgValidateLength @"This field cannot be blank"
45 |
46 |
47 | /**
48 | TextFieldValidator is the inherited class of UITextField for performing validation effectively. This class will handle all kind of validations with just few lines of code using regex and it is fully customisable. You can easily port this functionality in your existing code as well, you just need to change class name from UITextField to TextFieldValidator and apply regex for performing validation.
49 | */
50 | NS_CLASS_AVAILABLE_IOS(6_0) @interface TextFieldValidator : UITextField{
51 |
52 | }
53 |
54 | @property (nonatomic,assign) BOOL isMandatory; /**< Default is YES*/
55 |
56 | @property (nonatomic,retain) IBOutlet UIView *presentInView; /**< Assign view on which you want to show popup and it would be good if you provide controller's view*/
57 |
58 | @property (nonatomic,retain) UIColor *popUpColor; /**< Assign popup background color, you can also assign default popup color from macro "ColorPopUpBg" at the top*/
59 |
60 | @property (nonatomic,assign) BOOL validateOnCharacterChanged; /**< Default is YES, Use it whether you want to validate text on character change or not.*/
61 |
62 | @property (nonatomic,assign) BOOL validateOnResign; /**< Default is YES, Use it whether you want to validate text on resign or not.*/
63 |
64 | /**
65 | Use to add regex for validating textfield text, you need to specify all your regex in queue that you want to validate and their messages respectively that will show when any regex validation will fail.
66 | @param strRegx Regex string
67 | @param msg Message string to be displayed when given regex will fail.
68 | */
69 | -(void)addRegx:(NSString *)strRegx withMsg:(NSString *)msg;
70 |
71 | /**
72 | By deafult the message will be shown which is given in the macro "MsgValidateLength", but you can change message for each textfield as well.
73 | @param msg Message string to be displayed when length validation will fail.
74 | */
75 | -(void)updateLengthValidationMsg:(NSString *)msg;
76 |
77 | /**
78 | Use to add validation for validating confirm password
79 | @param txtPassword Hold reference of password textfield from which they will check text equality.
80 | */
81 | -(void)addConfirmValidationTo:(TextFieldValidator *)txtPassword withMsg:(NSString *)msg;
82 |
83 | /**
84 | Use to perform validation
85 | @return Bool It will return YES if all provided regex validation will pass else return NO
86 |
87 | Eg: If you want to apply validation on all fields simultaneously then refer below code which will be make it easy to handle validations
88 | if([txtField1 validate] & [txtField2 validate]){
89 | // Success operation
90 | }
91 | */
92 | -(BOOL)validate;
93 |
94 | /**
95 | Use to dismiss error popup.
96 | */
97 | -(void)dismissPopup;
98 |
99 | @end
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/xcuserdata/dhawaldawar.xcuserdatad/xcschemes/TextFieldValidationDemo.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 |
--------------------------------------------------------------------------------
/TextFieldValidator/TextFieldValidator.m:
--------------------------------------------------------------------------------
1 | //
2 | // TextFieldValidator.m
3 | // Textfield Error Handle
4 | //
5 | // Created by Dhawal Dawar on 22/11/12.
6 | // Copyright (c) 2012 Dhawal Dawar. All rights reserved.
7 | //
8 |
9 | #import "TextFieldValidator.h"
10 |
11 | @interface IQPopUp : UIView
12 |
13 | @property (nonatomic,assign) CGRect showOnRect;
14 | @property (nonatomic,assign) int popWidth;
15 | @property (nonatomic,assign) CGRect fieldFrame;
16 | @property (nonatomic,copy) NSString *strMsg;
17 | @property (nonatomic,retain) UIColor *popUpColor;
18 |
19 | @end
20 |
21 | @implementation IQPopUp
22 | @synthesize showOnRect,popWidth,fieldFrame,popUpColor;
23 |
24 | -(void)drawRect:(CGRect)rect{
25 | const CGFloat *color=CGColorGetComponents(popUpColor.CGColor);
26 |
27 | UIGraphicsBeginImageContext(CGSizeMake(30, 20));
28 | CGContextRef ctx = UIGraphicsGetCurrentContext();
29 | CGContextSetRGBFillColor(ctx, color[0], color[1], color[2], 1);
30 | CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), 7.0, [UIColor blackColor].CGColor);
31 | CGPoint points[3] = { CGPointMake(15, 5), CGPointMake(25, 25),
32 | CGPointMake(5,25)};
33 | CGContextAddLines(ctx, points, 3);
34 | CGContextClosePath(ctx);
35 | CGContextFillPath(ctx);
36 | UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
37 | UIGraphicsEndImageContext();
38 |
39 | CGRect imgframe=CGRectMake((showOnRect.origin.x+((showOnRect.size.width-30)/2)), ((showOnRect.size.height/2)+showOnRect.origin.y), 30, 13);
40 |
41 | UIImageView *img=[[UIImageView alloc] initWithImage:viewImage highlightedImage:nil];
42 | [self addSubview:img];
43 | img.translatesAutoresizingMaskIntoConstraints=NO;
44 | NSDictionary *dict=NSDictionaryOfVariableBindings(img);
45 | [img.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[img(%f)]",imgframe.origin.x,imgframe.size.width] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
46 | [img.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[img(%f)]",imgframe.origin.y,imgframe.size.height] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
47 |
48 | UIFont *font=[UIFont fontWithName:FontName size:FontSize];
49 | CGSize size=[self.strMsg boundingRectWithSize:CGSizeMake(fieldFrame.size.width-(PaddingInErrorPopUp*2), 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size;
50 | size=CGSizeMake(ceilf(size.width), ceilf(size.height));
51 |
52 | UIView *view=[[UIView alloc] initWithFrame:CGRectZero];
53 | [self insertSubview:view belowSubview:img];
54 | view.backgroundColor=self.popUpColor;
55 | view.layer.cornerRadius=5.0;
56 | view.layer.shadowColor=[[UIColor blackColor] CGColor];
57 | view.layer.shadowRadius=5.0;
58 | view.layer.shadowOpacity=1.0;
59 | view.layer.shadowOffset=CGSizeMake(0, 0);
60 | view.translatesAutoresizingMaskIntoConstraints=NO;
61 | dict=NSDictionaryOfVariableBindings(view);
62 | [view.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[view(%f)]",fieldFrame.origin.x+(fieldFrame.size.width-(size.width+(PaddingInErrorPopUp*2))),size.width+(PaddingInErrorPopUp*2)] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
63 | [view.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[view(%f)]",imgframe.origin.y+imgframe.size.height,size.height+(PaddingInErrorPopUp*2)] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
64 |
65 | UILabel *lbl=[[UILabel alloc] initWithFrame:CGRectZero];
66 | lbl.font=font;
67 | lbl.numberOfLines=0;
68 | lbl.backgroundColor=[UIColor clearColor];
69 | lbl.text=self.strMsg;
70 | lbl.textColor=ColorFont;
71 | [view addSubview:lbl];
72 |
73 | lbl.translatesAutoresizingMaskIntoConstraints=NO;
74 | dict=NSDictionaryOfVariableBindings(lbl);
75 | [lbl.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[lbl(%f)]",(float)PaddingInErrorPopUp,size.width] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
76 | [lbl.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[lbl(%f)]",(float)PaddingInErrorPopUp,size.height] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
77 | }
78 |
79 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
80 | [self removeFromSuperview];
81 | return NO;
82 | }
83 |
84 | @end
85 |
86 | @interface TextFieldValidatorSupport : NSObject
87 |
88 | @property (nonatomic,retain) id delegate;
89 | @property (nonatomic,assign) BOOL validateOnCharacterChanged;
90 | @property (nonatomic,assign) BOOL validateOnResign;
91 | @property (nonatomic,unsafe_unretained) IQPopUp *popUp;
92 | @end
93 |
94 | @implementation TextFieldValidatorSupport
95 | @synthesize delegate,validateOnCharacterChanged,popUp,validateOnResign;
96 |
97 | #pragma mark - UITextFieldDelegate
98 | - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
99 | if([delegate respondsToSelector:@selector(textFieldShouldBeginEditing:)])
100 | return [delegate textFieldShouldBeginEditing:textField];
101 | return YES;
102 | }
103 |
104 | - (void)textFieldDidBeginEditing:(UITextField *)textField{
105 | if([delegate respondsToSelector:@selector(textFieldDidBeginEditing:)])
106 | [delegate textFieldDidBeginEditing:textField];
107 | }
108 |
109 | - (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
110 | if([delegate respondsToSelector:@selector(textFieldShouldEndEditing:)])
111 | return [delegate textFieldShouldEndEditing:textField];
112 | return YES;
113 | }
114 |
115 | - (void)textFieldDidEndEditing:(UITextField *)textField{
116 | if([delegate respondsToSelector:@selector(textFieldDidEndEditing:)])
117 | [delegate textFieldDidEndEditing:textField];
118 | [popUp removeFromSuperview];
119 | if(validateOnResign)
120 | [(TextFieldValidator *)textField validate];
121 | }
122 |
123 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
124 | [(TextFieldValidator *)textField dismissPopup];
125 | if(validateOnCharacterChanged)
126 | [(TextFieldValidator *)textField performSelector:@selector(validate) withObject:nil afterDelay:0.1];
127 | else
128 | [(TextFieldValidator *)textField setRightView:nil];
129 | if([delegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)])
130 | return [delegate textField:textField shouldChangeCharactersInRange:range replacementString:string];
131 | return YES;
132 | }
133 |
134 | - (BOOL)textFieldShouldClear:(UITextField *)textField{
135 | if([delegate respondsToSelector:@selector(textFieldShouldClear:)])
136 | return [delegate textFieldShouldClear:textField];
137 | return YES;
138 | }
139 |
140 | - (BOOL)textFieldShouldReturn:(UITextField *)textField{
141 | if([delegate respondsToSelector:@selector(textFieldShouldReturn:)])
142 | return [delegate textFieldShouldReturn:textField];
143 | return YES;
144 | }
145 |
146 | -(void)setDelegate:(id)dele{
147 | delegate=dele;
148 | }
149 |
150 | @end
151 |
152 |
153 | @interface TextFieldValidator(){
154 | NSString *strLengthValidationMsg;
155 | TextFieldValidatorSupport *supportObj;
156 | NSString *strMsg;
157 | NSMutableArray *arrRegx;
158 | IQPopUp *popUp;
159 | UIColor *popUpColor;
160 | }
161 |
162 | -(void)tapOnError;
163 |
164 | @end
165 |
166 | @implementation TextFieldValidator
167 | @synthesize presentInView,validateOnCharacterChanged,popUpColor,isMandatory,validateOnResign;
168 |
169 | #pragma mark - Default Methods of UIView
170 | - (id)initWithFrame:(CGRect)frame{
171 | self = [super initWithFrame:frame];
172 | if (self) {
173 |
174 | }
175 | return self;
176 | }
177 |
178 | -(id)initWithCoder:(NSCoder *)aDecoder{
179 | self=[super initWithCoder:aDecoder];
180 | arrRegx=[[NSMutableArray alloc] init];
181 | validateOnCharacterChanged=YES;
182 | isMandatory=YES;
183 | validateOnResign=YES;
184 | popUpColor=ColorPopUpBg;
185 | strLengthValidationMsg=[MsgValidateLength copy];
186 | supportObj=[[TextFieldValidatorSupport alloc] init];
187 | supportObj.validateOnCharacterChanged=validateOnCharacterChanged;
188 | supportObj.validateOnResign=validateOnResign;
189 | NSNotificationCenter *notify=[NSNotificationCenter defaultCenter];
190 | [notify addObserver:self selector:@selector(didHideKeyboard) name:UIKeyboardWillHideNotification object:nil];
191 | return self;
192 | }
193 |
194 | -(void)setDelegate:(id)deleg{
195 | supportObj.delegate=deleg;
196 | super.delegate=supportObj;
197 | }
198 |
199 | -(void)setValidateOnCharacterChanged:(BOOL)validate{
200 | supportObj.validateOnCharacterChanged=validate;
201 | validateOnCharacterChanged=validate;
202 | }
203 |
204 | -(void)setValidateOnResign:(BOOL)validate{
205 | supportObj.validateOnResign=validate;
206 | validateOnResign=validate;
207 | }
208 |
209 | #pragma mark - Public methods
210 | -(void)addRegx:(NSString *)strRegx withMsg:(NSString *)msg{
211 | NSDictionary *dic=[[NSDictionary alloc] initWithObjectsAndKeys:strRegx,@"regx",msg,@"msg", nil];
212 | [arrRegx addObject:dic];
213 | }
214 |
215 | -(void)updateLengthValidationMsg:(NSString *)msg{
216 | strLengthValidationMsg=[msg copy];
217 | }
218 |
219 | -(void)addConfirmValidationTo:(TextFieldValidator *)txtConfirm withMsg:(NSString *)msg{
220 | NSDictionary *dic=[[NSDictionary alloc] initWithObjectsAndKeys:txtConfirm,@"confirm",msg,@"msg", nil];
221 | [arrRegx addObject:dic];
222 | }
223 |
224 | -(BOOL)validate{
225 | if(isMandatory){
226 | if([self.text length]==0){
227 | [self showErrorIconForMsg:strLengthValidationMsg];
228 | return NO;
229 | }
230 | }
231 | for (int i=0; i<[arrRegx count]; i++) {
232 | NSDictionary *dic=[arrRegx objectAtIndex:i];
233 | if([dic objectForKey:@"confirm"]){
234 | TextFieldValidator *txtConfirm=[dic objectForKey:@"confirm"];
235 | if(![txtConfirm.text isEqualToString:self.text]){
236 | [self showErrorIconForMsg:[dic objectForKey:@"msg"]];
237 | return NO;
238 | }
239 | }else if(![[dic objectForKey:@"regx"] isEqualToString:@""] && [self.text length]!=0 && ![self validateString:self.text withRegex:[dic objectForKey:@"regx"]]){
240 | [self showErrorIconForMsg:[dic objectForKey:@"msg"]];
241 | return NO;
242 | }
243 | }
244 | self.rightView=nil;
245 | return YES;
246 | }
247 |
248 | -(void)dismissPopup{
249 | [popUp removeFromSuperview];
250 | }
251 |
252 | #pragma mark - Internal Methods
253 |
254 | -(void)didHideKeyboard{
255 | [popUp removeFromSuperview];
256 | }
257 |
258 | -(void)tapOnError{
259 | [self showErrorWithMsg:strMsg];
260 | }
261 |
262 | - (BOOL)validateString:(NSString*)stringToSearch withRegex:(NSString*)regexString {
263 | NSPredicate *regex = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexString];
264 | return [regex evaluateWithObject:stringToSearch];
265 | }
266 |
267 | -(void)showErrorIconForMsg:(NSString *)msg{
268 | UIButton *btnError=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
269 | [btnError addTarget:self action:@selector(tapOnError) forControlEvents:UIControlEventTouchUpInside];
270 | [btnError setBackgroundImage:[UIImage imageNamed:IconImageName] forState:UIControlStateNormal];
271 | self.rightView=btnError;
272 | self.rightViewMode=UITextFieldViewModeAlways;
273 | strMsg=[msg copy];
274 | }
275 |
276 | -(void)showErrorWithMsg:(NSString *)msg{
277 | popUp=[[IQPopUp alloc] initWithFrame:CGRectZero];
278 | popUp.strMsg=msg;
279 | popUp.popUpColor=popUpColor;
280 | popUp.showOnRect=[self convertRect:self.rightView.frame toView:presentInView];
281 | popUp.fieldFrame=[self.superview convertRect:self.frame toView:presentInView];
282 | popUp.backgroundColor=[UIColor clearColor];
283 | [presentInView addSubview:popUp];
284 |
285 | popUp.translatesAutoresizingMaskIntoConstraints=NO;
286 | NSDictionary *dict=NSDictionaryOfVariableBindings(popUp);
287 | [popUp.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[popUp]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
288 | [popUp.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[popUp]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
289 | supportObj.popUp=popUp;
290 | }
291 |
292 | @end
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Classes/TextFieldValidator/TextFieldValidator.m:
--------------------------------------------------------------------------------
1 | //
2 | // TextFieldValidator.m
3 | // Textfield Error Handle
4 | //
5 | // Created by Dhawal Dawar on 22/11/12.
6 | // Copyright (c) 2012 Dhawal Dawar. All rights reserved.
7 | //
8 |
9 | #import "TextFieldValidator.h"
10 |
11 | @interface IQPopUp : UIView
12 |
13 | @property (nonatomic,assign) CGRect showOnRect;
14 | @property (nonatomic,assign) int popWidth;
15 | @property (nonatomic,assign) CGRect fieldFrame;
16 | @property (nonatomic,copy) NSString *strMsg;
17 | @property (nonatomic,retain) UIColor *popUpColor;
18 |
19 | @end
20 |
21 | @implementation IQPopUp
22 | @synthesize showOnRect,popWidth,fieldFrame,popUpColor;
23 |
24 | -(void)drawRect:(CGRect)rect{
25 | const CGFloat *color=CGColorGetComponents(popUpColor.CGColor);
26 |
27 | UIGraphicsBeginImageContext(CGSizeMake(30, 20));
28 | CGContextRef ctx = UIGraphicsGetCurrentContext();
29 | CGContextSetRGBFillColor(ctx, color[0], color[1], color[2], 1);
30 | CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), 7.0, [UIColor blackColor].CGColor);
31 | CGPoint points[3] = { CGPointMake(15, 5), CGPointMake(25, 25),
32 | CGPointMake(5,25)};
33 | CGContextAddLines(ctx, points, 3);
34 | CGContextClosePath(ctx);
35 | CGContextFillPath(ctx);
36 | UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
37 | UIGraphicsEndImageContext();
38 |
39 | CGRect imgframe=CGRectMake((showOnRect.origin.x+((showOnRect.size.width-30)/2)), ((showOnRect.size.height/2)+showOnRect.origin.y), 30, 13);
40 |
41 | UIImageView *img=[[UIImageView alloc] initWithImage:viewImage highlightedImage:nil];
42 | [self addSubview:img];
43 | img.translatesAutoresizingMaskIntoConstraints=NO;
44 | NSDictionary *dict=NSDictionaryOfVariableBindings(img);
45 | [img.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[img(%f)]",imgframe.origin.x,imgframe.size.width] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
46 | [img.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[img(%f)]",imgframe.origin.y,imgframe.size.height] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
47 |
48 | UIFont *font=[UIFont fontWithName:FontName size:FontSize];
49 | CGSize size=[self.strMsg boundingRectWithSize:CGSizeMake(fieldFrame.size.width-(PaddingInErrorPopUp*2), 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size;
50 | size=CGSizeMake(ceilf(size.width), ceilf(size.height));
51 |
52 | UIView *view=[[UIView alloc] initWithFrame:CGRectZero];
53 | [self insertSubview:view belowSubview:img];
54 | view.backgroundColor=self.popUpColor;
55 | view.layer.cornerRadius=5.0;
56 | view.layer.shadowColor=[[UIColor blackColor] CGColor];
57 | view.layer.shadowRadius=5.0;
58 | view.layer.shadowOpacity=1.0;
59 | view.layer.shadowOffset=CGSizeMake(0, 0);
60 | view.translatesAutoresizingMaskIntoConstraints=NO;
61 | dict=NSDictionaryOfVariableBindings(view);
62 | [view.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[view(%f)]",fieldFrame.origin.x+(fieldFrame.size.width-(size.width+(PaddingInErrorPopUp*2))),size.width+(PaddingInErrorPopUp*2)] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
63 | [view.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[view(%f)]",imgframe.origin.y+imgframe.size.height,size.height+(PaddingInErrorPopUp*2)] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
64 |
65 | UILabel *lbl=[[UILabel alloc] initWithFrame:CGRectZero];
66 | lbl.font=font;
67 | lbl.numberOfLines=0;
68 | lbl.backgroundColor=[UIColor clearColor];
69 | lbl.text=self.strMsg;
70 | lbl.textColor=ColorFont;
71 | [view addSubview:lbl];
72 |
73 | lbl.translatesAutoresizingMaskIntoConstraints=NO;
74 | dict=NSDictionaryOfVariableBindings(lbl);
75 | [lbl.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-%f-[lbl(%f)]",(float)PaddingInErrorPopUp,size.width] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
76 | [lbl.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[lbl(%f)]",(float)PaddingInErrorPopUp,size.height] options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
77 | }
78 |
79 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
80 | [self removeFromSuperview];
81 | return NO;
82 | }
83 |
84 | @end
85 |
86 | @interface TextFieldValidatorSupport : NSObject
87 |
88 | @property (nonatomic,retain) id delegate;
89 | @property (nonatomic,assign) BOOL validateOnCharacterChanged;
90 | @property (nonatomic,assign) BOOL validateOnResign;
91 | @property (nonatomic,unsafe_unretained) IQPopUp *popUp;
92 | @end
93 |
94 | @implementation TextFieldValidatorSupport
95 | @synthesize delegate,validateOnCharacterChanged,popUp,validateOnResign;
96 |
97 | #pragma mark - UITextFieldDelegate
98 | - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
99 | if([delegate respondsToSelector:@selector(textFieldShouldBeginEditing:)])
100 | return [delegate textFieldShouldBeginEditing:textField];
101 | return YES;
102 | }
103 |
104 | - (void)textFieldDidBeginEditing:(UITextField *)textField{
105 | if([delegate respondsToSelector:@selector(textFieldDidBeginEditing:)])
106 | [delegate textFieldDidBeginEditing:textField];
107 | }
108 |
109 | - (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
110 | if([delegate respondsToSelector:@selector(textFieldShouldEndEditing:)])
111 | return [delegate textFieldShouldEndEditing:textField];
112 | return YES;
113 | }
114 |
115 | - (void)textFieldDidEndEditing:(UITextField *)textField{
116 | if([delegate respondsToSelector:@selector(textFieldDidEndEditing:)])
117 | [delegate textFieldDidEndEditing:textField];
118 | [popUp removeFromSuperview];
119 | if(validateOnResign)
120 | [(TextFieldValidator *)textField validate];
121 | }
122 |
123 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
124 | [(TextFieldValidator *)textField dismissPopup];
125 | if(validateOnCharacterChanged)
126 | [(TextFieldValidator *)textField performSelector:@selector(validate) withObject:nil afterDelay:0.1];
127 | else
128 | [(TextFieldValidator *)textField setRightView:nil];
129 | if([delegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)])
130 | return [delegate textField:textField shouldChangeCharactersInRange:range replacementString:string];
131 | return YES;
132 | }
133 |
134 | - (BOOL)textFieldShouldClear:(UITextField *)textField{
135 | if([delegate respondsToSelector:@selector(textFieldShouldClear:)])
136 | return [delegate textFieldShouldClear:textField];
137 | return YES;
138 | }
139 |
140 | - (BOOL)textFieldShouldReturn:(UITextField *)textField{
141 | if([delegate respondsToSelector:@selector(textFieldShouldReturn:)])
142 | return [delegate textFieldShouldReturn:textField];
143 | return YES;
144 | }
145 |
146 | -(void)setDelegate:(id)dele{
147 | delegate=dele;
148 | }
149 |
150 | @end
151 |
152 |
153 | @interface TextFieldValidator(){
154 | NSString *strLengthValidationMsg;
155 | TextFieldValidatorSupport *supportObj;
156 | NSString *strMsg;
157 | NSMutableArray *arrRegx;
158 | IQPopUp *popUp;
159 | UIColor *popUpColor;
160 | }
161 |
162 | -(void)tapOnError;
163 |
164 | @end
165 |
166 | @implementation TextFieldValidator
167 | @synthesize presentInView,validateOnCharacterChanged,popUpColor,isMandatory,validateOnResign;
168 |
169 | #pragma mark - Default Methods of UIView
170 | - (id)initWithFrame:(CGRect)frame{
171 | self = [super initWithFrame:frame];
172 | if (self) {
173 | [self setup];
174 | }
175 | return self;
176 | }
177 |
178 | -(id)initWithCoder:(NSCoder *)aDecoder{
179 | self=[super initWithCoder:aDecoder];
180 | [self setup];
181 | return self;
182 | }
183 |
184 | -(void)setDelegate:(id)deleg{
185 | supportObj.delegate=deleg;
186 | super.delegate=supportObj;
187 | }
188 |
189 | -(void)setup{
190 | arrRegx=[[NSMutableArray alloc] init];
191 | validateOnCharacterChanged=YES;
192 | isMandatory=YES;
193 | validateOnResign=YES;
194 | popUpColor=ColorPopUpBg;
195 | strLengthValidationMsg=[MsgValidateLength copy];
196 | supportObj=[[TextFieldValidatorSupport alloc] init];
197 | supportObj.validateOnCharacterChanged=validateOnCharacterChanged;
198 | supportObj.validateOnResign=validateOnResign;
199 | NSNotificationCenter *notify=[NSNotificationCenter defaultCenter];
200 | [notify addObserver:self selector:@selector(didHideKeyboard) name:UIKeyboardWillHideNotification object:nil];
201 | }
202 |
203 | -(void)setValidateOnCharacterChanged:(BOOL)validate{
204 | supportObj.validateOnCharacterChanged=validate;
205 | validateOnCharacterChanged=validate;
206 | }
207 |
208 | -(void)setValidateOnResign:(BOOL)validate{
209 | supportObj.validateOnResign=validate;
210 | validateOnResign=validate;
211 | }
212 |
213 | #pragma mark - Public methods
214 | -(void)addRegx:(NSString *)strRegx withMsg:(NSString *)msg{
215 | NSDictionary *dic=[[NSDictionary alloc] initWithObjectsAndKeys:strRegx,@"regx",msg,@"msg", nil];
216 | [arrRegx addObject:dic];
217 | }
218 |
219 | -(void)updateLengthValidationMsg:(NSString *)msg{
220 | strLengthValidationMsg=[msg copy];
221 | }
222 |
223 | -(void)addConfirmValidationTo:(TextFieldValidator *)txtConfirm withMsg:(NSString *)msg{
224 | NSDictionary *dic=[[NSDictionary alloc] initWithObjectsAndKeys:txtConfirm,@"confirm",msg,@"msg", nil];
225 | [arrRegx addObject:dic];
226 | }
227 |
228 | -(BOOL)validate{
229 | if(isMandatory){
230 | if([self.text length]==0){
231 | [self showErrorIconForMsg:strLengthValidationMsg];
232 | return NO;
233 | }
234 | }
235 | for (int i=0; i<[arrRegx count]; i++) {
236 | NSDictionary *dic=[arrRegx objectAtIndex:i];
237 | if([dic objectForKey:@"confirm"]){
238 | TextFieldValidator *txtConfirm=[dic objectForKey:@"confirm"];
239 | if(![txtConfirm.text isEqualToString:self.text]){
240 | [self showErrorIconForMsg:[dic objectForKey:@"msg"]];
241 | return NO;
242 | }
243 | }else if(![[dic objectForKey:@"regx"] isEqualToString:@""] && [self.text length]!=0 && ![self validateString:self.text withRegex:[dic objectForKey:@"regx"]]){
244 | [self showErrorIconForMsg:[dic objectForKey:@"msg"]];
245 | return NO;
246 | }
247 | }
248 | self.rightView=nil;
249 | return YES;
250 | }
251 |
252 | -(void)dismissPopup{
253 | [popUp removeFromSuperview];
254 | }
255 |
256 | #pragma mark - Internal Methods
257 |
258 | -(void)didHideKeyboard{
259 | [popUp removeFromSuperview];
260 | }
261 |
262 | -(void)tapOnError{
263 | [self showErrorWithMsg:strMsg];
264 | }
265 |
266 | - (BOOL)validateString:(NSString*)stringToSearch withRegex:(NSString*)regexString {
267 | NSPredicate *regex = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexString];
268 | return [regex evaluateWithObject:stringToSearch];
269 | }
270 |
271 | -(void)showErrorIconForMsg:(NSString *)msg{
272 | UIButton *btnError=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
273 | [btnError addTarget:self action:@selector(tapOnError) forControlEvents:UIControlEventTouchUpInside];
274 | [btnError setBackgroundImage:[UIImage imageNamed:IconImageName] forState:UIControlStateNormal];
275 | self.rightView=btnError;
276 | self.rightViewMode=UITextFieldViewModeAlways;
277 | strMsg=[msg copy];
278 | }
279 |
280 | -(void)showErrorWithMsg:(NSString *)msg{
281 | popUp=[[IQPopUp alloc] initWithFrame:CGRectZero];
282 | popUp.strMsg=msg;
283 | popUp.popUpColor=popUpColor;
284 | popUp.showOnRect=[self convertRect:self.rightView.frame toView:presentInView];
285 | popUp.fieldFrame=[self.superview convertRect:self.frame toView:presentInView];
286 | popUp.backgroundColor=[UIColor clearColor];
287 | [presentInView addSubview:popUp];
288 |
289 | popUp.translatesAutoresizingMaskIntoConstraints=NO;
290 | NSDictionary *dict=NSDictionaryOfVariableBindings(popUp);
291 | [popUp.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[popUp]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
292 | [popUp.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[popUp]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:dict]];
293 | supportObj.popUp=popUp;
294 | }
295 |
296 | @end
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo/Supporting Files/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
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 |
102 |
109 |
116 |
123 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
--------------------------------------------------------------------------------
/TextFieldValidationDemo/TextFieldValidationDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 6C0CB9AA194868040036DA01 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0CB995194868040036DA01 /* AppDelegate.m */; };
11 | 6C0CB9AB194868040036DA01 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0CB998194868040036DA01 /* ViewController.m */; };
12 | 6C0CB9AC194868040036DA01 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0CB999194868040036DA01 /* main.m */; };
13 | 6C0CB9AD194868040036DA01 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C0CB99C194868040036DA01 /* SecondViewController.m */; };
14 | 6C0CB9AF194868040036DA01 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6C0CB9A1194868040036DA01 /* Main.storyboard */; };
15 | 6C0CB9B2194868040036DA01 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6C0CB9A7194868040036DA01 /* Images.xcassets */; };
16 | 6C265284194080A300948579 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C265283194080A300948579 /* Foundation.framework */; };
17 | 6C265286194080A300948579 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C265285194080A300948579 /* CoreGraphics.framework */; };
18 | 6C265288194080A300948579 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C265287194080A300948579 /* UIKit.framework */; };
19 | 6C2652A3194080A300948579 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C2652A2194080A300948579 /* XCTest.framework */; };
20 | 6C2652A4194080A300948579 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C265283194080A300948579 /* Foundation.framework */; };
21 | 6C2652A5194080A400948579 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C265287194080A300948579 /* UIKit.framework */; };
22 | 6C2652AD194080A400948579 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6C2652AB194080A400948579 /* InfoPlist.strings */; };
23 | 6C2652AF194080A400948579 /* TextFieldValidationDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C2652AE194080A400948579 /* TextFieldValidationDemoTests.m */; };
24 | 6C90C46E194B33B900AF714F /* TextFieldValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C90C46D194B33B900AF714F /* TextFieldValidator.m */; };
25 | /* End PBXBuildFile section */
26 |
27 | /* Begin PBXContainerItemProxy section */
28 | 6C2652A6194080A400948579 /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 6C265278194080A300948579 /* Project object */;
31 | proxyType = 1;
32 | remoteGlobalIDString = 6C26527F194080A300948579;
33 | remoteInfo = TextFieldValidationDemo;
34 | };
35 | /* End PBXContainerItemProxy section */
36 |
37 | /* Begin PBXFileReference section */
38 | 6C0CB994194868040036DA01 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
39 | 6C0CB995194868040036DA01 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
40 | 6C0CB997194868040036DA01 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
41 | 6C0CB998194868040036DA01 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
42 | 6C0CB999194868040036DA01 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
43 | 6C0CB99B194868040036DA01 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; };
44 | 6C0CB99C194868040036DA01 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; };
45 | 6C0CB9A2194868040036DA01 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
46 | 6C0CB9A4194868040036DA01 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
47 | 6C0CB9A5194868040036DA01 /* TextFieldValidationDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TextFieldValidationDemo-Info.plist"; sourceTree = ""; };
48 | 6C0CB9A6194868040036DA01 /* TextFieldValidationDemo-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TextFieldValidationDemo-Prefix.pch"; sourceTree = ""; };
49 | 6C0CB9A7194868040036DA01 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
50 | 6C265280194080A300948579 /* TextFieldValidationDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TextFieldValidationDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 6C265283194080A300948579 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
52 | 6C265285194080A300948579 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
53 | 6C265287194080A300948579 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
54 | 6C2652A1194080A300948579 /* TextFieldValidationDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TextFieldValidationDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 6C2652A2194080A300948579 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
56 | 6C2652AA194080A400948579 /* TextFieldValidationDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TextFieldValidationDemoTests-Info.plist"; sourceTree = ""; };
57 | 6C2652AC194080A400948579 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
58 | 6C2652AE194080A400948579 /* TextFieldValidationDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TextFieldValidationDemoTests.m; sourceTree = ""; };
59 | 6C90C46C194B33B900AF714F /* TextFieldValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextFieldValidator.h; sourceTree = ""; };
60 | 6C90C46D194B33B900AF714F /* TextFieldValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextFieldValidator.m; sourceTree = ""; };
61 | /* End PBXFileReference section */
62 |
63 | /* Begin PBXFrameworksBuildPhase section */
64 | 6C26527D194080A300948579 /* Frameworks */ = {
65 | isa = PBXFrameworksBuildPhase;
66 | buildActionMask = 2147483647;
67 | files = (
68 | 6C265286194080A300948579 /* CoreGraphics.framework in Frameworks */,
69 | 6C265288194080A300948579 /* UIKit.framework in Frameworks */,
70 | 6C265284194080A300948579 /* Foundation.framework in Frameworks */,
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | 6C26529E194080A300948579 /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | 6C2652A3194080A300948579 /* XCTest.framework in Frameworks */,
79 | 6C2652A5194080A400948579 /* UIKit.framework in Frameworks */,
80 | 6C2652A4194080A300948579 /* Foundation.framework in Frameworks */,
81 | );
82 | runOnlyForDeploymentPostprocessing = 0;
83 | };
84 | /* End PBXFrameworksBuildPhase section */
85 |
86 | /* Begin PBXGroup section */
87 | 6C0CB992194868040036DA01 /* Classes */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 6C0CB993194868040036DA01 /* AppDelegate */,
91 | 6C0CB996194868040036DA01 /* FormViewController */,
92 | 6C0CB999194868040036DA01 /* main.m */,
93 | 6C0CB99A194868040036DA01 /* SecondViewController */,
94 | 6C0CB99D194868040036DA01 /* TextFieldValidator */,
95 | );
96 | path = Classes;
97 | sourceTree = "";
98 | };
99 | 6C0CB993194868040036DA01 /* AppDelegate */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 6C0CB994194868040036DA01 /* AppDelegate.h */,
103 | 6C0CB995194868040036DA01 /* AppDelegate.m */,
104 | );
105 | path = AppDelegate;
106 | sourceTree = "";
107 | };
108 | 6C0CB996194868040036DA01 /* FormViewController */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 6C0CB997194868040036DA01 /* ViewController.h */,
112 | 6C0CB998194868040036DA01 /* ViewController.m */,
113 | );
114 | path = FormViewController;
115 | sourceTree = "";
116 | };
117 | 6C0CB99A194868040036DA01 /* SecondViewController */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 6C0CB99B194868040036DA01 /* SecondViewController.h */,
121 | 6C0CB99C194868040036DA01 /* SecondViewController.m */,
122 | );
123 | path = SecondViewController;
124 | sourceTree = "";
125 | };
126 | 6C0CB99D194868040036DA01 /* TextFieldValidator */ = {
127 | isa = PBXGroup;
128 | children = (
129 | 6C90C46C194B33B900AF714F /* TextFieldValidator.h */,
130 | 6C90C46D194B33B900AF714F /* TextFieldValidator.m */,
131 | );
132 | path = TextFieldValidator;
133 | sourceTree = "";
134 | };
135 | 6C0CB9A0194868040036DA01 /* Supporting Files */ = {
136 | isa = PBXGroup;
137 | children = (
138 | 6C0CB9A1194868040036DA01 /* Main.storyboard */,
139 | 6C0CB9A3194868040036DA01 /* InfoPlist.strings */,
140 | 6C0CB9A5194868040036DA01 /* TextFieldValidationDemo-Info.plist */,
141 | 6C0CB9A6194868040036DA01 /* TextFieldValidationDemo-Prefix.pch */,
142 | );
143 | path = "Supporting Files";
144 | sourceTree = "";
145 | };
146 | 6C265277194080A300948579 = {
147 | isa = PBXGroup;
148 | children = (
149 | 6C265289194080A300948579 /* TextFieldValidationDemo */,
150 | 6C2652A8194080A400948579 /* TextFieldValidationDemoTests */,
151 | 6C265282194080A300948579 /* Frameworks */,
152 | 6C265281194080A300948579 /* Products */,
153 | );
154 | sourceTree = "";
155 | };
156 | 6C265281194080A300948579 /* Products */ = {
157 | isa = PBXGroup;
158 | children = (
159 | 6C265280194080A300948579 /* TextFieldValidationDemo.app */,
160 | 6C2652A1194080A300948579 /* TextFieldValidationDemoTests.xctest */,
161 | );
162 | name = Products;
163 | sourceTree = "";
164 | };
165 | 6C265282194080A300948579 /* Frameworks */ = {
166 | isa = PBXGroup;
167 | children = (
168 | 6C265283194080A300948579 /* Foundation.framework */,
169 | 6C265285194080A300948579 /* CoreGraphics.framework */,
170 | 6C265287194080A300948579 /* UIKit.framework */,
171 | 6C2652A2194080A300948579 /* XCTest.framework */,
172 | );
173 | name = Frameworks;
174 | sourceTree = "";
175 | };
176 | 6C265289194080A300948579 /* TextFieldValidationDemo */ = {
177 | isa = PBXGroup;
178 | children = (
179 | 6C0CB992194868040036DA01 /* Classes */,
180 | 6C0CB9A0194868040036DA01 /* Supporting Files */,
181 | 6C0CB9A7194868040036DA01 /* Images.xcassets */,
182 | );
183 | path = TextFieldValidationDemo;
184 | sourceTree = "";
185 | };
186 | 6C2652A8194080A400948579 /* TextFieldValidationDemoTests */ = {
187 | isa = PBXGroup;
188 | children = (
189 | 6C2652AE194080A400948579 /* TextFieldValidationDemoTests.m */,
190 | 6C2652A9194080A400948579 /* Supporting Files */,
191 | );
192 | path = TextFieldValidationDemoTests;
193 | sourceTree = "";
194 | };
195 | 6C2652A9194080A400948579 /* Supporting Files */ = {
196 | isa = PBXGroup;
197 | children = (
198 | 6C2652AA194080A400948579 /* TextFieldValidationDemoTests-Info.plist */,
199 | 6C2652AB194080A400948579 /* InfoPlist.strings */,
200 | );
201 | name = "Supporting Files";
202 | sourceTree = "";
203 | };
204 | /* End PBXGroup section */
205 |
206 | /* Begin PBXNativeTarget section */
207 | 6C26527F194080A300948579 /* TextFieldValidationDemo */ = {
208 | isa = PBXNativeTarget;
209 | buildConfigurationList = 6C2652B2194080A400948579 /* Build configuration list for PBXNativeTarget "TextFieldValidationDemo" */;
210 | buildPhases = (
211 | 6C26527C194080A300948579 /* Sources */,
212 | 6C26527D194080A300948579 /* Frameworks */,
213 | 6C26527E194080A300948579 /* Resources */,
214 | );
215 | buildRules = (
216 | );
217 | dependencies = (
218 | );
219 | name = TextFieldValidationDemo;
220 | productName = TextFieldValidationDemo;
221 | productReference = 6C265280194080A300948579 /* TextFieldValidationDemo.app */;
222 | productType = "com.apple.product-type.application";
223 | };
224 | 6C2652A0194080A300948579 /* TextFieldValidationDemoTests */ = {
225 | isa = PBXNativeTarget;
226 | buildConfigurationList = 6C2652B5194080A400948579 /* Build configuration list for PBXNativeTarget "TextFieldValidationDemoTests" */;
227 | buildPhases = (
228 | 6C26529D194080A300948579 /* Sources */,
229 | 6C26529E194080A300948579 /* Frameworks */,
230 | 6C26529F194080A300948579 /* Resources */,
231 | );
232 | buildRules = (
233 | );
234 | dependencies = (
235 | 6C2652A7194080A400948579 /* PBXTargetDependency */,
236 | );
237 | name = TextFieldValidationDemoTests;
238 | productName = TextFieldValidationDemoTests;
239 | productReference = 6C2652A1194080A300948579 /* TextFieldValidationDemoTests.xctest */;
240 | productType = "com.apple.product-type.bundle.unit-test";
241 | };
242 | /* End PBXNativeTarget section */
243 |
244 | /* Begin PBXProject section */
245 | 6C265278194080A300948579 /* Project object */ = {
246 | isa = PBXProject;
247 | attributes = {
248 | LastUpgradeCheck = 0510;
249 | ORGANIZATIONNAME = Dhawal.Dawar;
250 | TargetAttributes = {
251 | 6C2652A0194080A300948579 = {
252 | TestTargetID = 6C26527F194080A300948579;
253 | };
254 | };
255 | };
256 | buildConfigurationList = 6C26527B194080A300948579 /* Build configuration list for PBXProject "TextFieldValidationDemo" */;
257 | compatibilityVersion = "Xcode 3.2";
258 | developmentRegion = English;
259 | hasScannedForEncodings = 0;
260 | knownRegions = (
261 | en,
262 | Base,
263 | );
264 | mainGroup = 6C265277194080A300948579;
265 | productRefGroup = 6C265281194080A300948579 /* Products */;
266 | projectDirPath = "";
267 | projectRoot = "";
268 | targets = (
269 | 6C26527F194080A300948579 /* TextFieldValidationDemo */,
270 | 6C2652A0194080A300948579 /* TextFieldValidationDemoTests */,
271 | );
272 | };
273 | /* End PBXProject section */
274 |
275 | /* Begin PBXResourcesBuildPhase section */
276 | 6C26527E194080A300948579 /* Resources */ = {
277 | isa = PBXResourcesBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | 6C0CB9AF194868040036DA01 /* Main.storyboard in Resources */,
281 | 6C0CB9B2194868040036DA01 /* Images.xcassets in Resources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | 6C26529F194080A300948579 /* Resources */ = {
286 | isa = PBXResourcesBuildPhase;
287 | buildActionMask = 2147483647;
288 | files = (
289 | 6C2652AD194080A400948579 /* InfoPlist.strings in Resources */,
290 | );
291 | runOnlyForDeploymentPostprocessing = 0;
292 | };
293 | /* End PBXResourcesBuildPhase section */
294 |
295 | /* Begin PBXSourcesBuildPhase section */
296 | 6C26527C194080A300948579 /* Sources */ = {
297 | isa = PBXSourcesBuildPhase;
298 | buildActionMask = 2147483647;
299 | files = (
300 | 6C0CB9AD194868040036DA01 /* SecondViewController.m in Sources */,
301 | 6C0CB9AB194868040036DA01 /* ViewController.m in Sources */,
302 | 6C0CB9AC194868040036DA01 /* main.m in Sources */,
303 | 6C0CB9AA194868040036DA01 /* AppDelegate.m in Sources */,
304 | 6C90C46E194B33B900AF714F /* TextFieldValidator.m in Sources */,
305 | );
306 | runOnlyForDeploymentPostprocessing = 0;
307 | };
308 | 6C26529D194080A300948579 /* Sources */ = {
309 | isa = PBXSourcesBuildPhase;
310 | buildActionMask = 2147483647;
311 | files = (
312 | 6C2652AF194080A400948579 /* TextFieldValidationDemoTests.m in Sources */,
313 | );
314 | runOnlyForDeploymentPostprocessing = 0;
315 | };
316 | /* End PBXSourcesBuildPhase section */
317 |
318 | /* Begin PBXTargetDependency section */
319 | 6C2652A7194080A400948579 /* PBXTargetDependency */ = {
320 | isa = PBXTargetDependency;
321 | target = 6C26527F194080A300948579 /* TextFieldValidationDemo */;
322 | targetProxy = 6C2652A6194080A400948579 /* PBXContainerItemProxy */;
323 | };
324 | /* End PBXTargetDependency section */
325 |
326 | /* Begin PBXVariantGroup section */
327 | 6C0CB9A1194868040036DA01 /* Main.storyboard */ = {
328 | isa = PBXVariantGroup;
329 | children = (
330 | 6C0CB9A2194868040036DA01 /* Base */,
331 | );
332 | name = Main.storyboard;
333 | sourceTree = "";
334 | };
335 | 6C0CB9A3194868040036DA01 /* InfoPlist.strings */ = {
336 | isa = PBXVariantGroup;
337 | children = (
338 | 6C0CB9A4194868040036DA01 /* en */,
339 | );
340 | name = InfoPlist.strings;
341 | sourceTree = "";
342 | };
343 | 6C2652AB194080A400948579 /* InfoPlist.strings */ = {
344 | isa = PBXVariantGroup;
345 | children = (
346 | 6C2652AC194080A400948579 /* en */,
347 | );
348 | name = InfoPlist.strings;
349 | sourceTree = "";
350 | };
351 | /* End PBXVariantGroup section */
352 |
353 | /* Begin XCBuildConfiguration section */
354 | 6C2652B0194080A400948579 /* Debug */ = {
355 | isa = XCBuildConfiguration;
356 | buildSettings = {
357 | ALWAYS_SEARCH_USER_PATHS = NO;
358 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
359 | CLANG_CXX_LIBRARY = "libc++";
360 | CLANG_ENABLE_MODULES = YES;
361 | CLANG_ENABLE_OBJC_ARC = YES;
362 | CLANG_WARN_BOOL_CONVERSION = YES;
363 | CLANG_WARN_CONSTANT_CONVERSION = YES;
364 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
365 | CLANG_WARN_EMPTY_BODY = YES;
366 | CLANG_WARN_ENUM_CONVERSION = YES;
367 | CLANG_WARN_INT_CONVERSION = YES;
368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
370 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
371 | COPY_PHASE_STRIP = NO;
372 | GCC_C_LANGUAGE_STANDARD = gnu99;
373 | GCC_DYNAMIC_NO_PIC = NO;
374 | GCC_OPTIMIZATION_LEVEL = 0;
375 | GCC_PREPROCESSOR_DEFINITIONS = (
376 | "DEBUG=1",
377 | "$(inherited)",
378 | );
379 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
380 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
381 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
382 | GCC_WARN_UNDECLARED_SELECTOR = YES;
383 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
384 | GCC_WARN_UNUSED_FUNCTION = YES;
385 | GCC_WARN_UNUSED_VARIABLE = YES;
386 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
387 | ONLY_ACTIVE_ARCH = YES;
388 | SDKROOT = iphoneos;
389 | };
390 | name = Debug;
391 | };
392 | 6C2652B1194080A400948579 /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ALWAYS_SEARCH_USER_PATHS = NO;
396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
397 | CLANG_CXX_LIBRARY = "libc++";
398 | CLANG_ENABLE_MODULES = YES;
399 | CLANG_ENABLE_OBJC_ARC = YES;
400 | CLANG_WARN_BOOL_CONVERSION = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
403 | CLANG_WARN_EMPTY_BODY = YES;
404 | CLANG_WARN_ENUM_CONVERSION = YES;
405 | CLANG_WARN_INT_CONVERSION = YES;
406 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
409 | COPY_PHASE_STRIP = YES;
410 | ENABLE_NS_ASSERTIONS = NO;
411 | GCC_C_LANGUAGE_STANDARD = gnu99;
412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
414 | GCC_WARN_UNDECLARED_SELECTOR = YES;
415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
416 | GCC_WARN_UNUSED_FUNCTION = YES;
417 | GCC_WARN_UNUSED_VARIABLE = YES;
418 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
419 | SDKROOT = iphoneos;
420 | VALIDATE_PRODUCT = YES;
421 | };
422 | name = Release;
423 | };
424 | 6C2652B3194080A400948579 /* Debug */ = {
425 | isa = XCBuildConfiguration;
426 | buildSettings = {
427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
428 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
429 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
430 | GCC_PREFIX_HEADER = "TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-Prefix.pch";
431 | INFOPLIST_FILE = "TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-Info.plist";
432 | PRODUCT_NAME = "$(TARGET_NAME)";
433 | WRAPPER_EXTENSION = app;
434 | };
435 | name = Debug;
436 | };
437 | 6C2652B4194080A400948579 /* Release */ = {
438 | isa = XCBuildConfiguration;
439 | buildSettings = {
440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
441 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
442 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
443 | GCC_PREFIX_HEADER = "TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-Prefix.pch";
444 | INFOPLIST_FILE = "TextFieldValidationDemo/Supporting Files/TextFieldValidationDemo-Info.plist";
445 | PRODUCT_NAME = "$(TARGET_NAME)";
446 | WRAPPER_EXTENSION = app;
447 | };
448 | name = Release;
449 | };
450 | 6C2652B6194080A400948579 /* Debug */ = {
451 | isa = XCBuildConfiguration;
452 | buildSettings = {
453 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TextFieldValidationDemo.app/TextFieldValidationDemo";
454 | FRAMEWORK_SEARCH_PATHS = (
455 | "$(SDKROOT)/Developer/Library/Frameworks",
456 | "$(inherited)",
457 | "$(DEVELOPER_FRAMEWORKS_DIR)",
458 | );
459 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
460 | GCC_PREFIX_HEADER = "TextFieldValidationDemo/TextFieldValidationDemo-Prefix.pch";
461 | GCC_PREPROCESSOR_DEFINITIONS = (
462 | "DEBUG=1",
463 | "$(inherited)",
464 | );
465 | INFOPLIST_FILE = "TextFieldValidationDemoTests/TextFieldValidationDemoTests-Info.plist";
466 | PRODUCT_NAME = "$(TARGET_NAME)";
467 | TEST_HOST = "$(BUNDLE_LOADER)";
468 | WRAPPER_EXTENSION = xctest;
469 | };
470 | name = Debug;
471 | };
472 | 6C2652B7194080A400948579 /* Release */ = {
473 | isa = XCBuildConfiguration;
474 | buildSettings = {
475 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TextFieldValidationDemo.app/TextFieldValidationDemo";
476 | FRAMEWORK_SEARCH_PATHS = (
477 | "$(SDKROOT)/Developer/Library/Frameworks",
478 | "$(inherited)",
479 | "$(DEVELOPER_FRAMEWORKS_DIR)",
480 | );
481 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
482 | GCC_PREFIX_HEADER = "TextFieldValidationDemo/TextFieldValidationDemo-Prefix.pch";
483 | INFOPLIST_FILE = "TextFieldValidationDemoTests/TextFieldValidationDemoTests-Info.plist";
484 | PRODUCT_NAME = "$(TARGET_NAME)";
485 | TEST_HOST = "$(BUNDLE_LOADER)";
486 | WRAPPER_EXTENSION = xctest;
487 | };
488 | name = Release;
489 | };
490 | /* End XCBuildConfiguration section */
491 |
492 | /* Begin XCConfigurationList section */
493 | 6C26527B194080A300948579 /* Build configuration list for PBXProject "TextFieldValidationDemo" */ = {
494 | isa = XCConfigurationList;
495 | buildConfigurations = (
496 | 6C2652B0194080A400948579 /* Debug */,
497 | 6C2652B1194080A400948579 /* Release */,
498 | );
499 | defaultConfigurationIsVisible = 0;
500 | defaultConfigurationName = Release;
501 | };
502 | 6C2652B2194080A400948579 /* Build configuration list for PBXNativeTarget "TextFieldValidationDemo" */ = {
503 | isa = XCConfigurationList;
504 | buildConfigurations = (
505 | 6C2652B3194080A400948579 /* Debug */,
506 | 6C2652B4194080A400948579 /* Release */,
507 | );
508 | defaultConfigurationIsVisible = 0;
509 | defaultConfigurationName = Release;
510 | };
511 | 6C2652B5194080A400948579 /* Build configuration list for PBXNativeTarget "TextFieldValidationDemoTests" */ = {
512 | isa = XCConfigurationList;
513 | buildConfigurations = (
514 | 6C2652B6194080A400948579 /* Debug */,
515 | 6C2652B7194080A400948579 /* Release */,
516 | );
517 | defaultConfigurationIsVisible = 0;
518 | defaultConfigurationName = Release;
519 | };
520 | /* End XCConfigurationList section */
521 | };
522 | rootObject = 6C265278194080A300948579 /* Project object */;
523 | }
524 |
--------------------------------------------------------------------------------