Use Auto-Layout with UIPresentationController
Asked Answered
H

0

11

I'm subclassing UIPresentationController to create a custom presentation/transition of a pop up UIViewController. The popup view itself should be constrained in the frame of the presenting view controller. I could do it with manual frame calculations but it would be greatly tedious and error prone in my view.

Looking at the API for UIPresentationController it looks like it strongly enforces the usage of CGSize's and CGRect's and insists on making you mix and match 'quasi auto layout' methods like systemlayoutSizeFitting and others and is just altogether confusing. I don't know which methods need to be overridden, when views exists, when they are added, which overrides return values are prioritized over other return values. Its basically a nightmare.

What, if any, is the simplest way to use the conventional constraint based layout I'm use to in this API?

Hamamelidaceous answered 3/5, 2018 at 16:52 Comment(1)
In the same situation, I wanted presentation controller for a background view so it was pretty simple. I didn’t override frame functions. I have used the presentation controller minimally and used the animator with auto layout.Vomer

© 2022 - 2024 — McMap. All rights reserved.