I\'m trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view t
Setting preferredContentSize
didn't work for me on iOS 11 for example when presenting EKEventEditViewController
.
It works only if I override getter of preferredContentSize
. Something like this:
private class CLEventEditViewController: EKEventEditViewController {
override var preferredContentSize: CGSize {
get {
if let fullSize = self.presentingViewController?.view.bounds.size {
return CGSize(width: fullSize.width * 0.5,
height: fullSize.height * 0.75)
}
return super.preferredContentSize
}
set {
super.preferredContentSize = newValue
}
}
}