Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rizumita/974078 to your computer and use it in GitHub Desktop.
Save rizumita/974078 to your computer and use it in GitHub Desktop.
Use UISearchBar & UISearchDisplayController
UISearchBar *searchBar = [[[UISearchBar alloc] initWithFrame:CGRectZero] autorelease];
[searchBar sizeToFit];
self.tableView.tableHeaderView = searchBar;
[[[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self] autorelease];
self.searchDisplayController.delegate = self;
self.searchDisplayController.searchResultsDataSource = self;
self.searchDisplayController.searchResultsDelegate = self;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment