Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
- if (string.length == 0) {
- return YES;
- }
- NSInteger length = textField.text.length+string.length;
- if (textField == pharmacyPhone_TF2 || textField == prescriberNumber_TF ) {
- if (length < 12) {
- [AppInfo toggleViewState:continueBtn isEnabled:[self shouldEnableButton]];
- }
- else {
- [AppInfo toggleViewState:continueBtn isEnabled:[self shouldEnableButton]];
- }
- }
- if ((textField == tf_first_name || textField == tf_last_name ) && length>25 ) {
- return NO;
- }
- if(textField == tf_allergies && length >50 ){
- return NO;
- }
- return YES;
- }
Add Comment
Please, Sign In to add comment