Last active
July 30, 2018 22:53
-
-
Save littlebobert/2a66bbe1265627dd151ea4a78e02e56e to your computer and use it in GitHub Desktop.
search bar inside a nav bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; | |
self.navigationItem.searchController = searchController; | |
self.definesPresentationContext = YES; | |
searchController.obscuresBackgroundDuringPresentation = NO; | |
self.navigationItem.searchController.searchBar.placeholder = NSLocalizedString(@"Search", @"search bar placeholder text. typing into this search field filters the content below"); | |
self.navigationItem.searchController.searchResultsUpdater = self; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment