Since the recent update to iOS 13+ I am unable to hide/show the UISearchController using the following code, which was working perfectly on iOS 12-
if index == 2 {
self.navigationItem.searchController = UISearchController()
} else {
self.navigationItem.searchController = self.search
}
Is it possible to show/hide UISearchController in IOS13+ ?