AnimationGroup
A collection of animations that play simultaneously.
Declaration
struct AnimationGroupOverview
This structure concurrently starts the animations it contains. Use a group to:
Animate more than one property at once.
Animate the same property at different times.
Animate multiple properties concurrently
For each animatable property your animation needs to control, create a group and add an animation to the array argument of the initializer. The following listing begins coding an animation group that colorizes 3D numbers that count down over a 4-second duration.
let frames: [Float] = [3.0, 2.0, 1.0, 0.0]
let duration = TimeInterval(frames.count)
let anim1 = FromToByAnimation<Float>(name: "colorize", from: 0.0, to: 1.0,
duration: duration, bindTarget: .parameter("foo"))
let anim2 = SampledAnimation<Float>(frames: frames, name: "count down",
frameInterval: duration / frames.count, bindTarget: .parameter("bar"))
let group = AnimationGroup(group: [anim1, anim2], name: "group")Create a sequence for the same animation
You can play the same animation at different times by grouping multiple AnimationDefinition objects that refer to the same animated property. To disperse their playback at runtime, give each definition a unique delay.