UIPresentationController's presentedViewController's frame isn't recalculated after dismissing a modal

Originator:harshilshah1910
Number:rdar://34301562 Date Originated:07-Sep-2017 11:24 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11 beta 10
Classification:Other Bug Reproducible:Always
 
Summary:
Consider a view controller A that presents a view controller B, using a custom UIPresentationController.

Next, B presents a view controller C, using a `modalPresentationStyle` other than `.currentContext` and `.overCurrentContext`, so that the C’s presentation controls B’s view.

Next, C is dismissed, so B becomes the topmost view controller again.

B’s frame isn’t automatically recalculated as per its own presentation controller, however

Steps to Reproduce:
1. Instantiate a view controller A
2. Present a view controller B from A, using a custom presentation controller that modifies B’s frame
3. Present a view controller C from B
4. Dismiss C


Expected Results:
B’s view’s frame is recalculated as per its own presentation controller, returning to the same state as before presenting C

Actual Results:
B’s view’s frame remains the same as set by C’s presentation. It needs to be manually set to `frameOfPresentedViewInContainerView` in `containerViewWillLayoutSubviews()`

Version:
iOS 11 beta 10

Notes:

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!