Skip to content

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

Notifications You must be signed in to change notification settings

fatuhoku/Resize-Popover-with-embedded-UINavigationController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published