What I need is that after taping on Search button, the searchBar returns to its initial state, so I can get to any UI element in one tap. Because currently I need to tap anywhere on screen once before I have ability to interact with other UI elements. I've tried searchBar.resignFirstResponder() and searchBar.endEditing(true) and other UIView.endEditing, but it won't work. Thanks for advance!
For example,
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
//search products, reload table and then:
searchBar.resignFirstResponder()
}
UPDATE: Found the solution! searchController.isActive = false