InteractiveAnimatorFactory.swift 825 B

1234567891011121314151617181920212223
  1. //
  2. // Created by Jake Lin on 4/6/16.
  3. // Copyright © 2016 IBAnimatable. All rights reserved.
  4. //
  5. import UIKit
  6. /**
  7. Interactive Animator Factory
  8. */
  9. struct InteractiveAnimatorFactory {
  10. static func makeInteractiveAnimator(interactiveGestureType: InteractiveGestureType, transitionType: TransitionType) -> InteractiveAnimator? {
  11. switch interactiveGestureType {
  12. case .pan:
  13. return PanInteractiveAnimator(interactiveGestureType: interactiveGestureType, transitionType: transitionType)
  14. case .screenEdgePan:
  15. return ScreenEdgePanInteractiveAnimator(interactiveGestureType: interactiveGestureType, transitionType: transitionType)
  16. case .pinch:
  17. return PinchInteractiveAnimator(interactiveGestureType: interactiveGestureType, transitionType: transitionType)
  18. default:
  19. return nil
  20. }
  21. }
  22. }