If I create a basic ViewController and add an opaque UIToolbar to the view, like so:
UIViewController* viewController = [[UIViewController alloc] init];
[viewController.view setBackgroundColor:[UIColor blueColor]]; // To make it easy to see
self.window.rootViewController = viewController;
UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, viewController.view.frame.size.height - 49, viewController.view.frame.size.width, 49)]; // At bottom. Height of 49
[toolbar setBarStyle:UIBarStyleBlack]; // Opaque and easy to see
[self.window.rootViewController.view addSubview:toolbar]; // Add toolbar to view controller
The view hierarchy ends up like below:
How do I make the View controller resize it's main area (the blue part) so it doesn't extend behind the UIToolbar?