Modal form sheet change preferredContentSize

I'm presenting a UINavigationController modally on iPad using the UIModalPresentationStyleFormSheet configuration. I can set the preferredContentSize in the first controller but I want to be able to change the size when pushing a new view controller with the navigation controller.


So far it seems like preferredContentSize is not respected for the new view controller regardless of where it is set. When I transition from the first presented view controller to the next the size remains the same.


Is it possible to change the size of form sheet after it's presented?

preferredContentSize is typically respected only by popovers.

You should consider implementing your own class conforming to the UIViewControllerAnimatedTransitioning protocol. This will let you control the animations and size of your modal view controllers.


Here is a link to sample code that should help:

https://developer.apple.com/library/content/samplecode/CustomTransitions/Listings/README_md.html#//apple_ref/doc/uid/TP40015158-README_md-DontLinkElementID_51

Modal form sheet change preferredContentSize
 
 
Q