Advertisement
JetForMe

Untitled

Feb 1st, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. @IBAction
  2. func
  3. showSearch(inSender: UIBarButtonItem)
  4. {
  5. // Save off the current results to restore when
  6. // the user is done with search…
  7.  
  8. self.searchSavedModels = self.models
  9.  
  10. // Create and present the search controller…
  11.  
  12. self.searchController = UISearchController(searchResultsController: nil)
  13. self.searchController!.searchResultsUpdater = self
  14. self.searchController!.searchBar.delegate = self
  15. self.searchController!.hidesNavigationBarDuringPresentation = true
  16. self.searchController!.dimsBackgroundDuringPresentation = false
  17. self.searchController!.searchBar.barTintColor = UIColor(colorLiteralRed: 0, green: 47.0 / 255.0, blue: 64.0 / 255.0, alpha: 1.0)
  18. self.searchController!.searchBar.tintColor = UIColor.whiteColor()
  19.  
  20. self.searchController!.searchBar.enablesReturnKeyAutomatically = false
  21. self.definesPresentationContext = true
  22. self.searchController!.extendedLayoutIncludesOpaqueBars = true
  23. self.searchController!.edgesForExtendedLayout = [.Left, .Bottom, .Right]
  24.  
  25.  
  26.  
  27. presentViewController(self.searchController!, animated: true, completion: nil)
  28. }
  29.  
  30. var searchController: UISearchController?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement