PimCoumans/AnimationPlanner

Cancelling sequence not working for complexer animations

Opened this issue · 0 comments

Problem

Any animation containing multiple other animations aren’t passing the cancelling on to their sub-animations, only flat sequences are cancelled.

Proposed solution

Add func cancel() to Animatable (or a more appropriate protocol) so every animation can handle it for their specific case. Maybe create default implementation for Animation where it just immediately executes changes again, but making sure RunningSequence only calls this method when it’s the currently running animation. For years now (who new) UIView animations are ‘additive’, meaning they can’t be cancelled by performing the same changes as the animation. Either the currently running animations are played out and subsequent animations are cancelled, or a UIViewPropertyAnimators runs for each animations that can be cancelled.