Animation

public class Animation

Defines an object that handles the creation of animations for specific actions and keys.

  • Specifies the supported animation curves.

    animation.curve = .EaseIn
    
    See more

    Declaration

    Swift

    public enum Curve
  • Determines if the animation plays in the reverse upon completion.

    Declaration

    Swift

    public var autoreverses = false
  • Specifies the number of times the animation should repeat.

    Declaration

    Swift

    public var repeatCount = 0.0
  • If true the animation will repeat indefinitely.

    Declaration

    Swift

    public var repeats: Bool
  • The duration of the animation, measured in seconds.

    Declaration

    Swift

    public var duration: NSTimeInterval = 1
  • The animation curve that the receiver will apply to the changes it is supposed to animate.

    Declaration

    Swift

    public var curve: Curve = .EaseInOut
  • Intializes an empty animation object.

    Declaration

    Swift

    public init()
  • Adds a completion observer to an animation.

    The completion observer listens for the end of the animation then executes a specified block of code.

    Declaration

    Swift

    public func addCompletionObserver(action: () -> Void) -> AnyObject

    Parameters

    action

    a block of code to be executed at the end of an animation.

    Return Value

    the observer object.

  • Removes a specified observer from an animation.

    Declaration

    Swift

    public func removeCompletionObserver(observer: AnyObject)

    Parameters

    observer

    the observer object to remove.

  • Posts a completion event.

    This method is triggered when an animation completes. This can be used in place of addCompletionObserver for objects outside the scope of the context in which the animation is created.

    Declaration

    Swift

    public func postCompletedEvent()
  • Adds a cancel observer to an animation.

    The cancel observer listens for when an animation is canceled then executes a specified block of code.

    Declaration

    Swift

    public func addCancelObserver(action: () -> Void) -> AnyObject

    Parameters

    action

    a block of code to be executed when an animation is canceled.

    Return Value

    the observer object.

  • Removes a specified cancel observer from an animation.

    Declaration

    Swift

    public func removeCancelObserver(observer: AnyObject)

    Parameters

    observer

    the cancel observer object to remove.

  • Posts a cancellation event.

    This method is triggered when an animation is canceled. This can be used in place of addCancelObserver for objects outside the scope of the context in which the animation is created.

    Declaration

    Swift

    public func postCancelledEvent()