How do I adjust the constraint when pushing a new UIViewController when a UISearchController is implemented as self.navigationItem.searchController = search
New controller pushed: SearchBar collapses but leaves View with constrait to top = 0 on the initial position.
(The background of the ViewController is yellow for easy understanding of the matter)
Implementation:
viewDidLoad() { if #available(iOS 11.0, *) { let search = UISearchController(searchResultsController: nil) search.searchResultsUpdater = self search.definesPresentationContext = true search.hidesNavigationBarDuringPresentation = false search.searchBar.tintColor = UI.COLOR_WHITE search.dimsBackgroundDuringPresentation = false self.navigationItem.hidesSearchBarWhenScrolling = false self.navigationItem.searchController = search } I have tried using self.automaticallyAdjustsScrollViewInsets = false without success and the tableView implements self.contentInsetAdjustmentBehavior = .always
What am I missing? Help is very appreciated.


0 comments:
Post a Comment