How do I get a UISearchController to work with the search bar control in Interface Builder? I have tried the followin code:
@IBOutlet weak var searchBar: UISearchBar!
searchController.searchBar = searchBar
This gives me an error during coding time saying that searchController.searchBar is a get-only property.
@IBOutlet weak var searchBar: UISearchBar!
searchBar = searchController.searchBar
This gives me the UI I want, but the search doesn’t work.
var searchBar: UISearchBar!
searchBar = searchController.searchBar
NSLayoutConstraint(searchBar, ..... )
This works, except that when I start typing in the search bar, the search bar disappears.