fatuhoku / Resize-Popover-with-embedded-UINavigationController

Demonstrates how a popover containing a navigation controller can resize itself dynamically, animating resize and push at the same time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I animate the resizing of UIPopoverController containing a UINavigationController based on the sizes of the view controllers being pushed?

Normally, setting preferredContentSize on a view controller you want to present with a UIPopoverController is enough to trigger the popover's animated resize.

However when presenting a UINavigationController in a popover, setting preferredContentSize causes the resize animation to be performed after the push transition (see kylesluder/PopoverSizing).

The solution is to use view controller containment wrap the UINavigationController in a containing UIViewController (i.e. make UINavigationController), which we then manipulate the preferredContentSize of. We can make sure this is done every time a view controller is pushed by supplying a delegate to the navigation controller.

See MESViewController.m for more details.

About

Demonstrates how a popover containing a navigation controller can resize itself dynamically, animating resize and push at the same time.


Languages

Language:Objective-C 100.0%