I have a container view that is nearly the full screen sans the status bar.
I then created a UISearchController and a UITableView. I am using ios 9 and doing things
Well the constraints are definitely wrong
They should be like this:
NSDictionary *views = @{@"tableView": self.tableView,@"searchBar": self.searchController.searchBar};
[containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[searchBar]|" options:0 metrics:nil views:views]];
[containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[tableView]|" options:0 metrics:nil views:views]];
[containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[searchBar(44)][tableView]|" options:0 metrics:nil views:views]];
First of all, as you see, you don't need to create a separate dictionary with the views, but you can use one (more simple IMHO)
Second the constraints are as follows:
@"H:|[searchBar]|"
--> The searchbar is pinned to the left & right of the containerView with the system default (8px) margin@"H:|[tableView]|"
--> The tableView is pinned to the left & right of the containerView with the system default (8px) margin@"V:|[searchBar(44)][tableView]|"
-->