I tend to arrange my views using View.AddConstraints, which works nicely.
However on one particular view controller I have a UISearchBar with a UITableList below it. Using View.AddConstraints, the UITableList fills the View from the bottom of the UISearchBar to the bottom of the View.
Under some circumstances, when the List is populated I would like to display a MKMapView as well, and can do this on a static, permanent basis, by filling the main View from the bottom of the searchable to the bottom of the view with a "parentView", and then using View.AddConstraints to position the UITableList above the MKMapView inside the parent view, taking 50% of the available height, each.
This is all fine - however, what I need to do is to make the map display dynamic. Sometimes I want to display just the UITableList, and other times, depending on the results I want to share the space with a MKMapView.
What is best practise for doing this? Is it to throw away all the constraints for a View and rebuilt them on the fly.... or is there a better way.