Well I read this article, however the scope bar just shows instantly, no animation.
This should work:
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
[searchBar setShowsCancelButton:YES animated:YES];
searchBar.showsScopeBar = YES;
return YES;
}
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar {
[searchBar setShowsCancelButton:NO animated:YES];
[searchBar sizeToFit];
searchBar.showsScopeBar = NO;
return YES;
}
Remember to associate the UISearchBar delegate.