I am currently presenting a modal with a view at the bottom. Unfortunately, when the modal is displayed, the view controller is pushed down some and cuts off the bottom view found on this controller. Is there a way to calculate how much the view is getting pushed down to move the bottom view a bit higher? Thank you in advance!
I am presenting my modal through a navigation controller:
self.navigationController?.present(vc, animated: true, completion: nil)
On the modal presented view controller, view is added as follows:
if let b = Bundle.main.loadNibNamed(String.init(format: "%@", "MyView"), owner: self, options: nil) {
if let addedView = b[0] as? MyViewButton {
addedView.configureOnScreen(view: self.View)
}
}
I am presenting my bottom view inside a custom class that extends UIView:
func configureOnScreen(view: UIView) {
let width = view.frame.width - self.frame.width
let height = view.frame.height - self.frame.height
self.frame = CGRect.init(x: width, y: height, width: self.frame.width, height: self.frame.height)
view.addSubview(self)
}