Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 1.46 KB

README.md

File metadata and controls

58 lines (43 loc) · 1.46 KB

UIModal

There are two primary modes of displaying UIViewControllers 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.

CrossDisolve TableView

FlipHorizontal TableView

OverfullScreen TableView

PartialCurl TableView

Links that help