I am pretty new to UISearchController so pardon if this is a silly question.
I tried following this question but was not able to get the results I wanted.
In my MapViewController's
viewDidLoad
I initialize the search controller like so:
searchController = UISearchController(searchResultsController: customViewController)
where customViewController is a subclass UIViewController with some text labels for now (through interface builder).
(I declare it like so: let customViewController = MyCustomeViewController()
I tried to follow the above link by hiding and unhiding the searchResultsController
with searchController.searchResultsController?.view.isHidden = false
in the delegate methods to no luck.
The result is the same: where only the view is dimmed.
Ideally I want it to be something similar to Facebook's app where when you tap the search bar it shows a different view.
I printed the searchResultsController
object in the delegate willPresentSearchController
and it does indicate it as MyCustomViewController
.
Am I missing something here or is this not the right approach?