Skip to content

Instantly share code, notes, and snippets.

@StanislavK
Created October 10, 2017 08:04
Show Gist options
  • Select an option

  • Save StanislavK/c7a65b819a32e1bf77d933971f9c49d9 to your computer and use it in GitHub Desktop.

Select an option

Save StanislavK/c7a65b819a32e1bf77d933971f9c49d9 to your computer and use it in GitHub Desktop.
let searchController = UISearchController(searchResultsController: nil)
if #available(iOS 11.0, *) {
self.navigationItem.searchController = searchController
searchController.isActive = true
}
else {
present(searchController, animated: true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment