Skip to content

Instantly share code, notes, and snippets.

@matthiaswenz
Last active January 1, 2016 03:49
Show Gist options
  • Save matthiaswenz/8088229 to your computer and use it in GitHub Desktop.
Save matthiaswenz/8088229 to your computer and use it in GitHub Desktop.
UISearchBar customize Keyboard Return button type (iOS 7)
for (UIView *subview in searchBar.subviews) {
for (UIView *subSubview in subview.subviews) {
if ([subSubview conformsToProtocol:@protocol(UITextInputTraits)]) {
UIView<UITextInputTraits> *textInputField = (UIView<UITextInputTraits> *)subSubview;
textInputField.returnKeyType = UIReturnKeyDone;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment