Show search bar in navigation bar without scrolling on iOS 11
The following makes the search bar visible at first, then allows it to hide when scrolling: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if #available(iOS 11.0, *) { navigationItem.hidesSearchBarWhenScrolling = false } } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if #available(iOS 11.0, *) { navigationItem.hidesSearchBarWhenScrolling = true } } Using isActive didn’t do what … Read more