When running the App on iOS 13 beta 6, using Xcode 11 beta 5 I\'m encountering the strange gap when presenting search results view controller:
Here\'s a bit o
For me the problem was that UISearchController didn't update it's frame when search bar moved upwards. I fixed it by setting frame of UISearchController to the frame of it's presenting view controller.
extension UISearchController {
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let presentingVC = self.presentingViewController {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.view.frame = presentingVC.view.frame
}
}
}
}
In viewWillAppear animation of search bar did not start so you have to wait for a split second. When animation starts, frame of presenting VC is set to the correct value and then you can update frame of your UISearchController. The solution is a hack but it works fine for me.