UINavigationController no longer relays preferredContentSize changes

Originator:matej
Number:rdar://17435075 Date Originated:24-Jun-2014 04:45 PM
Status:Open Resolved:
Product:iOS Product Version:8.0
Classification: Reproducible:Always
 
Summary:
In previous iOS versions, changing the preferredContentSize of a view controller that is the topViewController of a UINavigationController, which in turn is in a UIPopoverController, would cause the popover controller to resize. Similarly pushing a new view controller onto the UINavigationController stack, would cause the UINavigationController to resize, if it's content size was not large enough. This no longer happens with iOS 8.

Steps to Reproduce:
Build an run the attached PopoverContentSizeTest project. 
Run the example on iOS 7 and iOS 8 and compare the different popover sizing behaviors by pressing the various UIBarButton items. 

Expected Results:
The iOS 8 behavior should match more closely that of iOS 7. Ideally, popping the navigation controller would also shrink the popover, which does not occur automatically on neither OS version. 

Actual Results:
The popover controller does not resize on iOS 8. 

Version:
iOS 8, beta 2

Notes:

Configuration:
iPad

Comments

Sample project

http://cl.ly/2g2Y2D1l1930

A small update on this. I managed to restore to the pre-iOS 8 behavior where the popover resized automatically, by manually passing on the preferred content size to the parent UINavigationController:

  • (void)setPreferredContentSize:(CGSize)preferredContentSize { [super setPreferredContentSize:preferredContentSize]; // Required for iOS 8 self.navigationController.preferredContentSize = preferredContentSize; }

This was not needed on iOS 7. Is this intentional or a bug?

Updated with iOS 8, Seed 3

The issue is slightly improved, but still not fully resolved. See the attached sample project. Run it on iOS 8 beta 3, invoke the popover (right bar button item) and keep pressing the resize button (left bar button item on the popover). The popover size increases the first time, but than doesn't decrease anyone. If you do the same on iOS 7.x, the popover will increase and decrease in size while the resize button in being pressed. The popover also doesn't shrink back if you push a new navigation controller (right bar button item on the popover) and than pop back (back button). This also works without issues on iOS 7.x.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!