There are two primary modes of displaying UIViewController
s in modal form along with transitions.
modalPresentationStyle
modalTransitionStyle
public enum UIModalPresentationStyle : Int {
case fullScreen
case pageSheet
case formSheet
case currentContext
case custom
case overFullScreen
case overCurrentContext
case popover
case none
}
public enum UIModalTransitionStyle : Int {
case coverVertical
case flipHorizontal
case crossDissolve
case partialCurl
}
Use basically create your ViewController and then set properties as follows
@objc func buttonPressed() {
let vc = ModalViewController()
vc.modalPresentationStyle = .fullScreen
vc.modalTransitionStyle = .partialCurl
present(vc, animated: true)
}
Here are some of the more interesting outputs.