Hi all,
I’m trying to create a custom presentationcontroller, but I’m having the following issue.
The view controller that is presented, should slide in from the bottom and only cover a part of the screen (like the Apple Pay sheet in iOS11), but in my case the height of the view controller that will be shown is dynamic.
When you implement a presentationcontroller, you override the frameOfPresentedViewInContainerView
property.
In my case I have now this:
override var frameOfPresentedViewInContainerView: CGRect {
var newFrame = CGRect.zero
if let width = containerView?.bounds.width, let height = containerView?.bounds.height {
newFrame.origin = CGPoint(x: 0, y: height - 100)
newFrame.size = CGSize(width: width, height: 100)
}
return newFrame
}
But I want to get rid of the height: 100
, this has to be dynamic. But I can’t seem to find a way to get the calculated AutoLayout height of my presented viewcontroller.
Anyone who know how to do this?
Thanks a lot in advance.