Animation
open class Animation : NSObject
Animation is used to set presentation and dismissal animations for presentables.
Depending on the transition in use, different properties of a UIViewController are set to make sure the transition animation is used.
Note
To not override the previously set Animation, use nil when initializing a transition.
Make sure to hold a strong reference to the Animation object, as it is only held by a weak reference.
-
Use
Animation.defaultto override currently set animations and reset to the default animations provided by iOSNote
To disable animations make sure to use non-animatingTransitionOptionswhen triggering.Declaration
Swift
public static let `default`: Animation
-
The transition animation performed when transitioning to a presentable.
Declaration
Swift
open var presentationAnimation: TransitionAnimation? -
The transition animation performed when transitioning away from a presentable.
Declaration
Swift
open var dismissalAnimation: TransitionAnimation?
-
Creates an Animation object containing a presentation and a dismissal animation.
Declaration
Swift
public init(presentation: TransitionAnimation?, dismissal: TransitionAnimation?)Parameters
presentationThe transition animation performed when transitioning to a presentable.
dismissalThe transition animation performed when transitioning away from a presentable.
-
See UIViewControllerTransitioningDelegate for further reference.
Declaration
Swift
open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning?Parameters
presentedThe view controller to be presented.
presentingThe view controller that is presenting.
sourceThe view controller whose
present(_:animated:completion:)was called.Return Value
The presentation animation when initializing the
Animationobject. -
See UIViewControllerTransitioningDelegate for further reference.
Declaration
Swift
open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning?Parameters
dismissedThe view controller to be dismissed.
Return Value
The dismissal animation when initializing the
Animationobject. -
See UIViewControllerTransitioningDelegate for further reference.
Declaration
Swift
open func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?Parameters
animatorThe animator of this transition, which is most likely the presentation animation.
Return Value
The presentation animation’s interaction controller.
-
See UIViewControllerTransitioningDelegate for further reference.
Declaration
Swift
open func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?Parameters
animatorThe animator of this transition, which is most likely the dismissal animation.
Return Value
The dismissal animation’s interaction controller.
View on GitHub
Animation Class Reference