Guest User

Untitled

a guest
Dec 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
  2.  
  3. if (string.length == 0) {
  4. return YES;
  5. }
  6. NSInteger length = textField.text.length+string.length;
  7.  
  8. if (textField == pharmacyPhone_TF2 || textField == prescriberNumber_TF ) {
  9. if (length < 12) {
  10. [AppInfo toggleViewState:continueBtn isEnabled:[self shouldEnableButton]];
  11. }
  12. else {
  13. [AppInfo toggleViewState:continueBtn isEnabled:[self shouldEnableButton]];
  14. }
  15. }
  16.  
  17.  
  18. if ((textField == tf_first_name || textField == tf_last_name ) && length>25 ) {
  19. return NO;
  20. }
  21. if(textField == tf_allergies && length >50 ){
  22. return NO;
  23. }
  24. return YES;
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment