ViewAnimation

public class ViewAnimation: Animation

ViewAnimation is a concrete subclass of Animation whose execution blocks affect properties of view-based objects.

  • An optional Spring structure. If this value is non-nil, property animations will default to CASpringAnimation if they are able.

    Declaration

    Swift

    public var spring: Spring?
  • The amount of time to way before executing the animation.

    Declaration

    Swift

    public var delay: NSTimeInterval = 0
  • A block animations to execute.

    Declaration

    Swift

    public var animations: () -> Void
  • Initializes an animation object with a block of animtinos to execute.

    let anim = ViewAnimation() { aView.backgroundColor = C4Blue }

    Declaration

    Swift

    public init(_ animations: () -> Void)

    Parameters

    animations

    a block of animations to execute.

  • Initializes a new ViewAnimation.

    let v = View(frame: Rect(0,0,100,100))
    canvas.add(v)
    let bg = ViewAnimation(duration: 0.25) {
        v.backgroundColor = C4Blue
    }
    delay(1.0) {
        bg.animate()
    }
    

    Declaration

    Swift

    public convenience init(duration: NSTimeInterval, animations: () -> Void)

    Parameters

    duration

    The length of the animations, measured in seconds.

    animations

    A block containing a variety of animations to execute

  • This timingFunction represents one segment of a function that defines the pacing of an animation as a timing curve. The function maps an input time normalized to the range [0,1] to an output time also in the range [0,1]. Options are Linear, EaseOut, EaseIn, EaseInOut

    Declaration

    Swift

    public var timingFunction: CAMediaTimingFunction
  • Options for animating views using block objects.

    Declaration

    Swift

    public var options: UIViewAnimationOptions
  • Initiates the changes specified in the receivers animations block.

    Declaration

    Swift

    public override func animate()