Skip to content

Instantly share code, notes, and snippets.

@samrayner
Last active October 13, 2015 18:58
Show Gist options
  • Save samrayner/4241616 to your computer and use it in GitHub Desktop.
Save samrayner/4241616 to your computer and use it in GitHub Desktop.
Use UITextField tags as tabindex for a UIView
-(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