With iPad with iOS6, we have this bug where a modal view controller will expand to full screen, even if it is told to
be using "form sheet" presentation style. But, this happens only if there are two modals, a parent one and its child.

Presenting multiple modals clearly breaks the way Apple say you should be doing things. If you end up doing things like this which go against Apple' advice then expect problems like this. Also consider you probably have a very bad design. If you want to show multiple viewControllers like this you should be using containment or a navigationController in a single modal presentation. What are you going to do when this breaks again in iOS 6.3?
–
aderFeb 19 '13 at 11:41

Thanks for pointing me at this, for what it's worth I thought you were trying to present more than one modal viewController from a single viewController parent (not chaining). I have always personally had the viewControllers in a navigation controller. Feel like an ass I do ;)
–
aderFeb 20 '13 at 19:29

3 Answers
3

Not sure if this should be considered as a bug and I'm curious what iOS 7 will bring, but the current workaround for this issue is to set modalPresentationStyle to UIModalPresentationCurrentContext for the child-viewController.

Set modalPresentationStyle = UIModalPresentationCurrentContext

This makes the child still beeing presented as FormSheet but prevents the parent from beeing resized to fullscreen on rotation.

1) in iOS 6 the method presentModalViewController:animated: is deprecated, try using presentViewController:animated:completion:
(despite this might not help, you still may want to do it)

2) In iOS 6 somehow appeared that container controllers (such as UINavigationController) don't resend the autorotate messages to their children. Try subclassing the UINavigationController and redefine the corresponding autorotation methods to be sent to all of the children. This might help.

1. Agreed. At the time I wrote this, we were still supporting 4.3.<br/> <br/> 2. I haven't encountered issues when testing and so far from the field. I do use navigation controllers a lot. Maybe my content controllers are generic enough and do not exhibit any problems...<br/> <br/> I guess we will see with iOS7, since Apple seems to change the way rotation callbacks works with every major version... ;-)
–
GenesisSTMay 13 '13 at 16:26