Changing ViewControllers in ViewContainer Messing Up UIDatePicker

I'm changing view controllers programmatically which appears to work but the UIDatePickers in my view are not displaying correctly. Is there some sort of view update function I need to call?

I'm changing views using the following code...

  [self addChildViewController:controller];
	[self.viewContainer addSubview:controller.view];
	[self.viewContainer bringSubviewToFront:controller.view];
	controller.view.frame = self.viewContainer.bounds;

This is called from the viewWillAppear call.

This is what it looks like when I first bring up the view.

And this is what it looks like when I turn the phone sideways and then back to portrait.

It sorts itself out. I feel like I'm missing some calls. Any ideas?

It's probably something to do with constraints, or you may be positioning/sizing something in viewDidLoad that needs to be done in viewWillAppear.
You might like to share the relevant code from "controller"?

Changing ViewControllers in ViewContainer Messing Up UIDatePicker
 
 
Q