Wrong bounds for UICollectionView when UIPageViewController is added as child view controller
| Originator: | jaherhi | ||
| Number: | rdar://26416962 | Date Originated: | 23-May-2016 12:13 PM |
| Status: | Duplicate of 28391611 | Resolved: | No |
| Product: | iOS SDK | Product Version: | 9.3.2 (13F69) |
| Classification: | N/A | Reproducible: | Always |
Summary: Using storyboards, when a UIViewController, which contains a UICollectionView, is used in a UIPageViewController which is added as a child view controller of a UIViewController, and the user navigates to the detail view controller of the items in the UICollectionView and rotates, the bounds for the UICollectionView turns out to be wrong Steps to Reproduce: 1. Download the sample code 2. Build and run the app in portrait 3. Rotate to landscape 4. Rotate back to portrait 5. Tap any cell 6. Rotate the device or simulator to landscape 7. Tap the back button 8. Notice the layout is different than the one showed when the device or simulator was rotated the first time Expected Results: The layout should be the same on both cases, when the device or simulator is rotated while the collection view is visible and when the device or simulator is rotated while the detail view controller is visible Actual Results: The layout is different on both cases because the bounds for the collection view are different in collectionView:collectionViewLayout:sizeForItemAtIndexPath: Version: 9.3.2 (13F69) Notes: This behaviour doesn't happen if the UIPageViewController is the root view controller of the UINavigationController. To reproduce this case: 1. Download the sample code 2. Remove the segue in Main.storyboard between UINavigationController and ViewController 3. Add a root view controller segue between UINavigationController and PageViewController 4. Build and run the app in portrait 5. Rotate to landscape 6. Rotate back to portrait 7. Tap any cell 8. Rotate the device or simulator to landscape 9. Tap the back button 10. Notice the layout is the same that was showed when the device or simulator was rotated the first time Configuration: iPhone 5 16GB with iOS 9.3.2 (13F69), iOS Simulator 9.3, 8.4 and 8.1, Xcode 7.3.1 (7D1014) Sample app: https://github.com/jaherhi/radar.apple.com/tree/master/26416962-UICollectionViewWrongBoundsInUIPageViewController
Comments
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!