Skip to content

Instantly share code, notes, and snippets.

@tylerlantern
Created December 27, 2018 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylerlantern/61e8150ddd46b6ccb3de656048d97b7a to your computer and use it in GitHub Desktop.
Save tylerlantern/61e8150ddd46b6ccb3de656048d97b7a to your computer and use it in GitHub Desktop.
override public func presentationTransitionWillBegin() {
super.presentationTransitionWillBegin()
dimmingView.frame = presentingViewController.view.bounds
containerView?.addSubview(dimmingView)
guard let coordinator = presentedViewController.transitionCoordinator else {
return
}
coordinator.animate(alongsideTransition: { (context) in
self.dimmingView.alpha = 0.5
}, completion: nil)
}
override public func dismissalTransitionWillBegin() {
super.dismissalTransitionWillBegin()
guard let coordinator = presentedViewController.transitionCoordinator else {
return
}
coordinator.animate(alongsideTransition: { (context) in
self.dimmingView.alpha = 0.0
}, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment