SHARE
TWEET

Untitled

a guest Jun 17th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (BOOL)textFieldShouldReturn:(UITextField*)textField;
  2.      
  3. - (BOOL)textFieldShouldReturn:(UITextField*)textField {
  4.     NSInteger nextTag = textField.tag + 1;
  5.     UIResponder* nextResponder = [textField.superview viewWithTag:nextTag];
  6.  
  7.     if (nextResponder) {
  8.         [nextResponder becomeFirstResponder];
  9.     } else {
  10.         [textField resignFirstResponder];
  11.     }
  12.     return NO;
  13. }
  14.      
  15. - (BOOL)textFieldShouldReturn:(UITextField*)textField {
  16.     NSUInteger nextIndex = [arrayWithResponders indexOfObject:textField]+1 % [arrayWithResponders count];
  17.     UIResponder* nextResponder = [arrayWithTextFields objectAtIndex: nextIndex];
  18.  
  19.     if (nextResponder) {
  20.         [nextResponder becomeFirstResponder];
  21.     } else {
  22.         [textField resignFirstResponder];
  23.     }
  24.     return NO;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top