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. ^^