Skip to content

Instantly share code, notes, and snippets.

@aliHafizji
Created June 10, 2013 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliHafizji/5750549 to your computer and use it in GitHub Desktop.
Save aliHafizji/5750549 to your computer and use it in GitHub Desktop.
//manually add a search bar
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 3, 320, 44)];
searchBar.delegate = self;
[searchBar setPlaceholder:NSLocalizedString(@"SearchNearbyPlaces", nil)];
UISearchDisplayController *searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self.navigationController];
searchDisplayController.searchResultsDataSource = self;
searchDisplayController.searchResultsDelegate = self;
searchDisplayController.delegate = self;
self.tableView.tableHeaderView = searchBar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment