1

i have problem with animation of navigation bar when pushing other view controller also with UISearchController to navigation controller. If i push ViewController without SearchController everything is OK. The problem can be seen when on the screen with UITableView scroll down for display UISearchController in navigation bar then push UIViewController too with SearchController to UINavigationController, but on place of UISearchController is only some gray view and the animation of transformation the navigation bar isnt fluent. The gray view disappers after one sec (see image).

This is how it looks like:

This is how I add the UISearchController to navigationBar in viewDidLoad(_:):

      private let searchController = UISearchController(searchResultsController: nil)
      navigationItem.searchController = searchController

In viewDidLoad(_:) i call only this:

   private func setupSearch() {
        searchController.searchBar.placeholder = "Suche"
        searchController.searchBar.setValue(abbrechen, forKey: cancelButtonText)
        searchController.searchResultsUpdater = self
        searchController.dimsBackgroundDuringPresentation = true
   }

Do you know where could be problem? Thx for your time.

  • Ok the question is already answered: [LINK HERE](https://stackoverflow.com/questions/46301813/broken-uisearchbar-animation-embedded-in-navigationitem) It helps me. – Martin Matějka Feb 13 '18 at 11:13

0 Answers0