I'm using UIPopoverPresentationController
for popovers in an iOS app. When a navigation controller in a popover pushes a new view controller, the popover resizes to that view controller's preferredContentSize
. But when the navigation controller pops a view controller off the stack, the popover does not resize to the previous size. How can I make it do that?
Possible duplicate of this question, but for the modern UIPopoverPresentationController
.
Update: See here for example code illustrating the problem. Clone it and run it in an iPad simulator. Tap the Popover button and you get a popover with a nav controller. Tap the Push bar button item and you get a new taller VC on the stack (the size is in the nav bar). Pop and it doesn't resize back down to what it was.
UINavigationController
that I use to solve this issue, so I overrode all the variants of push and pop and applied this principle there instead of in all the VCs I can have in nav controllers in popovers. – Bibliophage