Skip to content

Instantly share code, notes, and snippets.

@jagbolanos
Created July 2, 2012 22:46
Show Gist options
  • Select an option

  • Save jagbolanos/3036204 to your computer and use it in GitHub Desktop.

Select an option

Save jagbolanos/3036204 to your computer and use it in GitHub Desktop.
Enable search button when empty text
- (void) enableSearchEmpty {
UITextField *searchBarTextField = nil;
for (UIView *subview in searchBar.subviews)
{
if ([subview isKindOfClass:[UITextField class]])
{
searchBarTextField = (UITextField *)subview;
break;
}
}
searchBarTextField.enablesReturnKeyAutomatically = NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment