When starting the app, if the user doesn\'t have login information stored, I want to display a modal view controller to force the entry of this information. I found through
I find that both presenting and dismissing modal view controllers cause this, especially when you want to do custom layouting in -viewDidLoad
(which some say you shouldn't, but I've never found a better, working way). What I do is:
[self.view addSubview:self.viewController1.view]; // I suppose this layouts all (sub)views.
[self.viewController1.view removeFromSuperview];
Now you can present as such:
self.viewController1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.viewController2 presentModalViewController:self.viewController1 animated:YES];
without risking viewController1 to be laid out in a foul way until transition done, then snapping to wherever it should be. The same applies to dismissing. Works for me on iOS 3.0 though 5.0, iPhone and iPad.