Enable Search button when searching string is empty in default search bar

Actually you can just set searchBar.enablesReturnKeyAutomatically = NO; Tested on iOS 7+


This code display Search Button if you have empty string.

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar 
{
    [self.searchBar setShowsCancelButton:YES animated:YES];
    self.tblView.allowsSelection = NO;
    self.tblView.scrollEnabled = NO;
    
    UITextField *searchBarTextField = nil;
    for (UIView *subview in self.searchBar.subviews)
    {
        if ([subview isKindOfClass:[UITextField class]])
        {
            searchBarTextField = (UITextField *)subview;
            break;
        }
    }
    searchBarTextField.enablesReturnKeyAutomatically = NO;
}