Implement CAKeyframeAnimation and CAAnimationGroup - #434
Open
michaelknoch wants to merge 4 commits into
Open
Conversation
Mirrors the iOS API so shared player code (the reward message's medal flip) no longer needs an `#if os(iOS)` fork. * CAKeyframeAnimation with values, keyTimes and per-segment timingFunctions * CAAnimationGroup, flattened into its children on add, clipped to the group's duration * transform.scale and transform.scale.x key paths, applied multiplicatively so parallel scale animations compose instead of overwriting each other * CAMediaTimingFunctionName, so CAMediaTimingFunction(name: .easeOut) works Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ephemer
approved these changes
Sep 1, 2026
ephemer
left a comment
Member
There was a problem hiding this comment.
I haven't used CAKeyframeAnimation or CAAnimationGroup so API-wise I'm taking your word for it. Code-wise it looks sound to me 🙏🏼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings keyframe animations and animation groups to UIKit-SDL, matching the iOS API so shared player code can drop its
#if os(iOS)fork (the reward message's checkmark → medal flip stayed frozen on Android because these types didn't exist).What's in here
CAKeyframeAnimation—values,keyTimes,timingFunctions. Segments are picked fromkeyTimes(evenly spaced when omitted) and eased with the matching entry oftimingFunctions; atimingFunctionset on the animation itself still acts as overall pacing, as on iOS.CAAnimationGroup—animations,duration.CALayer.addflattens a group into its children under"<key>.<index>", clipping each child to the group's duration and adding the group's delay, so the existing per-animation progress and completion handling applies unchanged.transform.scale/transform.scale.xkey paths — applied multiplicatively onto the presentation transform, so two parallel scale animations compose instead of the last one winning.CAMediaTimingFunctionName—CAMediaTimingFunction(name: .easeOut)now compiles here too.CALayer.addusesanimation.copy()instead of hardcodingCABasicAnimation(from:), so subclasses keep their own fields.values/keyTimesare[CGFloat]?rather than iOS's[Any]?/[NSNumber]?— the literal call sites are identical either way, and this avoidsNSNumberon Android.Tests
Five tests in
UIKitTests/Animations/CAKeyframeAnimationTests.swiftcover keyframe interpolation,keyTimes-driven segment durations, parallel children in a group, duration clipping, and that children are copied on add. Full UIKit suite passes;FlowkeyPlayer MacandFlowkeyPlayer iOSbuild.🤖 Generated with Claude Code