I am presenting a modal view controller using UIPresentationController. I am setting the frame of presentedView less than the containView\'s bounds using following method:
I encountered the same issue. I couldn't solve it by adding constraints, and -[UIPresentationController containerViewWillLayoutSubviews]
is called too late (after the dismiss animation is completed).
After some time I figured out that the problem seems to be that the presenting controller view is being removed from the view hierarchy when you present with the default UIModalPresentationFullScreen
presentationStyle
and added again with a full screen size when it has to be shown again.
In iOS 8, you can use UIModalPresentationOverFullScreen
as the presentationStyle
when presenting from the smaller controller. The system will not automatically remove the presenting controller's view then. (-[UIViewController viewWillDisappear:]
and such, doesn't get called on the presenting controller when you do this though)
You can also use UIModalPresentationCustom
which is available in iOS 7, but then you'll have to provide your own transition animation.