Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction
- func
- showSearch(inSender: UIBarButtonItem)
- {
- // Save off the current results to restore when
- // the user is done with search…
- self.searchSavedModels = self.models
- // Create and present the search controller…
- self.searchController = UISearchController(searchResultsController: nil)
- self.searchController!.searchResultsUpdater = self
- self.searchController!.searchBar.delegate = self
- self.searchController!.hidesNavigationBarDuringPresentation = true
- self.searchController!.dimsBackgroundDuringPresentation = false
- self.searchController!.searchBar.barTintColor = UIColor(colorLiteralRed: 0, green: 47.0 / 255.0, blue: 64.0 / 255.0, alpha: 1.0)
- self.searchController!.searchBar.tintColor = UIColor.whiteColor()
- self.searchController!.searchBar.enablesReturnKeyAutomatically = false
- self.definesPresentationContext = true
- self.searchController!.extendedLayoutIncludesOpaqueBars = true
- self.searchController!.edgesForExtendedLayout = [.Left, .Bottom, .Right]
- presentViewController(self.searchController!, animated: true, completion: nil)
- }
- var searchController: UISearchController?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement