A lightweight, customizable subclass of UITextField that supports multiple regex validations and provides a simple UI to provide validation feedback.
See the original blog post for details: https://dhawaldawar.wordpress.com/2014/06/11/uitextfield-validation-ios/
A lightweight, customizable subclass of UITextField that supports multiple regex validations and provides a simple UI to provide validation feedback.
See the original blog post for details: https://dhawaldawar.wordpress.com/2014/06/11/uitextfield-validation-ios/
Using CocoaPods
- Add the pod
TextFieldValidator
to your Podfile.
pod 'TextFieldValidator'
- Run
pod install
from Terminal, then open your app's.xcworkspace
file to launch Xcode. - Import the
TextFieldValidator.h
umbrella header.
- Objective-C:
#import "TextFieldValidator.h"
[[TextFieldValidator appearance] setPopUpColor:[UIColor orangeColor]];
UIImage* img = [UIImage imageNamed:@"customError"];
[[TextFieldValidator appearance] setErrorImg:img];
[[TextFieldValidator appearance] setPopUpShadowColor:[UIColor clearColor]];
[[TextFieldValidator appearance] setPopUpFont:[UIFont fontWithName:FontName size:25]];
That's it - now go to design a form with TextFieldValidator!