Skip to content

Instantly share code, notes, and snippets.

@vinczebalazs
Created January 19, 2020 22:09
Show Gist options
  • Save vinczebalazs/f0d40a01a4a925e659d0c95bbb31e736 to your computer and use it in GitHub Desktop.
Save vinczebalazs/f0d40a01a4a925e659d0c95bbb31e736 to your computer and use it in GitHub Desktop.
extension UIViewController {
func presentAsSheet(_ vc: UIViewController, height: CGFloat) {
let presentationController = SheetModalPresentationController(presentedViewController: vc,
presenting: self,
height: height)
vc.transitioningDelegate = presentationController
vc.modalPresentationStyle = .custom
present(vc, animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment