ViewAnimationGroup

public class ViewAnimationGroup: Animation

Groups animations so that they can all be run at the same time. The completion call is dispatched when all the animations in the group have finished. This class ignores the duration property.

  • Initializes a set of animations to be executed at the same time.

    let v = View(frame: Rect(0,0,100,100))
    canvas.add(v)
    let bg = ViewAnimation(duration: 0.25) {
        v.backgroundColor = C4Blue
    }
    let ctr = ViewAnimation(duration: 0.25) {
        v.center = self.canvas.center
    }
    let grp = ViewAnimationGroup(animations: [bg,ctr])
    delay(1.0) {
        grp.animate()
    }
    

    Declaration

    Swift

    public init(animations: [Animation])

    Parameters

    animations

    An array of C4Animations

  • Calling this method will tell the receiver to begin animating.

    Declaration

    Swift

    public override func animate()