I want to add a UISearchBar to a UITableView that already has a title. When I try to add a search bar to an existing title, it works until I touch it, after which I get The view hierarchy is not prepared for the constraint
, which looks like the search bar is not a direct view of the table, so when UISearchController is trying to update restrictions that it cannot.
The only way I found is to make the table title a title in the search bar, then everything will be fine, but, of course, then I will lose the other views that were already in the title view.
source share