Skip to content

v0.9.3 - Result builders Phase 2

Compare
Choose a tag to compare
@PimCoumans PimCoumans released this 20 Jun 18:21
· 8 commits to main since this release

Warning: [breaking change] The completion parameter has been removed for theAnimationPlanner.plan and .group methods. Read on how to set your completion handler

AnimationPlanner now uses the new structs for all animations created through its API. Even the (now deprecated) UIView.animateSteps method results in a sequence animation handled by Animate and its friends.

To keep tabs on running animations, the RunningSequence class can be used. It is returned from the AnimationPlanner.plan and .group methods. RunningSequence shows the current state, all animations added, but also has a .stopAnimations() method to stop the current and cancel queued animations.

Use onComplete(_ handler: (_ finished: Bool) -> Void)) on the returned RunningSequence to perform logic when the sequence completes (or is stopped). Because the class is returned when creating your animation sequence, adding a completion handler can be done just like with a trailing closure:

AnimationPlanner.plan {
    // your animations
}.onComplete { finished in
    print(“finished!”)
}