How do you dismiss a UISearchController ? (iOS 8 and follow)

OK so after more testing, turns out you just have to set: searchController.active = false // or swift 4+ searchController.isActive = false This is the first thing I tried but I called it in one of the UISearchControllerDelegate methods which didn’t work (probably should have called it with dispatch_async (halbano’s answer seems to confirm that)). … Read more

Attempting to load the view of a view controller while it is deallocating… UISearchController

UISearchController’s view has to be removed from its superview before deallocate. (guess it is a bug) Objective-C… -(void)dealloc { [searchController.view removeFromSuperview]; // It works! } Swift 3… deinit { self.searchController.view.removeFromSuperview() } I struggled with this issue for a couple of weeks. ^^

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)