Repository navigation
fix(ios): replay loop animations when the app becomes active again - #67
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Summary
Closes #66.
On iOS a looping animation stopped for good after the app went to the background and came back: the view sat at its resting value until it remounted. Core Animation drops a layer's animations while the app is backgrounded. The saved loop snapshots (
_loopAnimations) were only replayed fromdidMoveToWindow, which doesn't run here because the view never leaves its window.EaseViewnow replays its saved loops onUIApplicationDidBecomeActiveNotification, after dropping any the current props no longer ask for (same as the window path).UIApplicationWillEnterForegroundNotificationis too early: animations added then were dropped again.reapplyLoopAnimationsnow skips keys that still have an animation, since becoming active also follows inactive-only interruptions (Control Center, system alerts) where nothing was removed; re-adding would only churnonTransitionEndaccounting.Loops keep their phase: the snapshots carry an explicit
beginTime, so a loop picks up where it would have been.Test Plan
iOS simulator (iPhone 16 Pro, iOS 18.6, Debug), on the example's Loop → Pause / Resume marquee:
The new Issues → Issue #66 — Background loops screen (a spinner and a pulse) is for regression checks.