I'm trying to translate some Objective-C code to SWIFT.
I'm loading a UIViewController as a Form Sheet. Here's the code in objective-c:
generalPopup.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
generalPopup.modalPresentationStyle = UIModalPresentationFormSheet;
Here's the code in Swift:
generalPopup.modalTransitionStyle = UIModalTransitionStyle.CoverVertical
generalPopup.modalPresentationStyle = UIModalPresentationStyle.FormSheet
In Objective-C the view is shown as a FormSheet. In swift, the CoverVertical is maintained, but the view takes the whole screen instead of being shown as FormSheet.
Just as a reminder, according to Apple a FormSheet is:
A view presentation style in which the width and height of the presented view are smaller than those of the screen and the view is centered onscreen. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.