I have a custom transition for presenting a view controller and I use a UIPresentationController
subclass to perform the presentation.
In the presentation controller I add a couple of subviews to its containerView
(the chrome). I would like to constrain one of them with something like the topLayoutGuide
in order to account for the height of any top bars (like the status bar).
However, UIPresentationController
is not a UIViewController
subclass and as such it doesn't have a topLayoutGuide
property. I tried constraining the views with the presentingViewController
's and the presentedViewController
's topLayoutGuide
but the app crashes because they are not part of the same view hierarchy.
So is there any way to position subviews inside the presentation controller's containerView
at its top while still accounting for the height of any top bars?