Skip to content

Instantly share code, notes, and snippets.

@xcadaverx
Created July 27, 2016 00:12
Show Gist options
  • Save xcadaverx/6a8c6ad2eb1850c471e0a7f42e8ebbd4 to your computer and use it in GitHub Desktop.
Save xcadaverx/6a8c6ad2eb1850c471e0a7f42e8ebbd4 to your computer and use it in GitHub Desktop.
class TransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate {
var openingFrame: CGRect?
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
let presentationAnimator = PresentationAnimator()
presentationAnimator.openingFrame = openingFrame!
return presentationAnimator
}
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
let dismissAnimator = DismissalAnimator()
dismissAnimator.openingFrame = openingFrame!
return dismissAnimator
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment