AnimatedPresenting.swift 513 B

1234567891011121314151617
  1. //
  2. // Created by Tom Baranes on 16/07/16.
  3. // Copyright © 2016 Jake Lin. All rights reserved.
  4. //
  5. import UIKit
  6. public protocol AnimatedPresenting: ViewControllerAnimatedTransitioning {
  7. }
  8. public extension AnimatedPresenting {
  9. func isPresenting(transitionContext: UIViewControllerContextTransitioning) -> Bool {
  10. let (fromViewController, toViewController, _) = retrieveViewControllers(transitionContext: transitionContext)
  11. return toViewController?.presentingViewController == fromViewController
  12. }
  13. }