CrossDissolveAnimation.swift 726 B

12345678910111213141516171819202122232425
  1. //
  2. // CrossDissolveAnimation.swift
  3. // Pods
  4. //
  5. // Created by Daniel Lozano Valdés on 3/21/17.
  6. //
  7. //
  8. import Foundation
  9. public class CrossDissolveAnimation: PresentrAnimation {
  10. override public func beforeAnimation(using transitionContext: PresentrTransitionContext) {
  11. transitionContext.animatingView?.alpha = transitionContext.isPresenting ? 0.0 : 1.0
  12. }
  13. override public func performAnimation(using transitionContext: PresentrTransitionContext) {
  14. transitionContext.animatingView?.alpha = transitionContext.isPresenting ? 1.0 : 0.0
  15. }
  16. override public func afterAnimation(using transitionContext: PresentrTransitionContext) {
  17. transitionContext.animatingView?.alpha = 1.0
  18. }
  19. }