Last active
October 13, 2015 18:58
-
-
Save samrayner/4241616 to your computer and use it in GitHub Desktop.
Use UITextField tags as tabindex for a UIView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)textFieldShouldReturn:(UITextField*)textField; | |
{ | |
NSInteger nextTag = textField.tag + 1; | |
UIResponder *nextResponder = [self.view viewWithTag:nextTag]; | |
if(nextResponder) { | |
[nextResponder becomeFirstResponder]; | |
} | |
else { | |
[self.view endEditing:YES]; | |
} | |
return NO; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment