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 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
, (on line 7) 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?
This is a screenshot of what I'm trying to do => https://www.dropbox.com/s/9s8odfy6hjnnnrx/Screen_Shot_2017_06_05_at_3.58.50_PM.png?dl=0
Kind regards, and thanks in advance.