Unable to define modalPresentationContext with custom transition

Originator:brian.michel
Number:rdar://31163999 Date Originated:3/20/2017
Status:Open Resolved:
Product:iOS + SDK Product Version:
Classification:Serious Bug Reproducible:Always
 
GitHub Sample Code: https://github.com/brianmichel/CustomTransitionFailure

Summary:
Setting definesPresentationContext has no effect when using a custom view controller transition and presentation controller. This means that it is impossible to achieve custom presentations that mimic the behavior of "modalPresentationStyle = currentContext" or the like.

Steps to Reproduce:
1. Download the sample project
2. Run the project and tap on the orange view

Expected Results:
Since the tapped view controller (OtherViewController) defines it’s own presentation context (ViewController.swift:146) I expect that the presented view controller can be presented within the bounds of the presenting view controller.

Actual Results:
The presented view controller’s transition view is inserted higher up in the view hierarchy due to the inability of custom presentation controllers to respect custom presentation contexts.

As a test, you can override the private value on ViewController.swift:85 with a value of true to see the desired behavior.


Version:
iOS 10.3 (14E5273a)

Notes:


Configuration:
iPhone 7 Plus, 128 GB

Attachments:
'CustomTransitionFailure Compressed.zip' was successfully uploaded.

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!