Skip to content

fix(ios): do not assign the 'spring' curve as a timing function - #6

Open
farfromrefug wants to merge 1 commit into
mainfrom
fix/ios-spring-timing-function
Open

fix(ios): do not assign the 'spring' curve as a timing function#6
farfromrefug wants to merge 1 commit into
mainfrom
fix/ios-spring-timing-function

Conversation

@farfromrefug

Copy link
Copy Markdown

Summary

Any view animated with curve: 'spring' crashes the app on iOS.

_createBasicAnimation uses curve to pick CASpringAnimation, then falls through to basicAnimation.timingFunction = curve and assigns the string 'spring' where CoreAnimation expects a CAMediaTimingFunction. The assignment is silent. The abort comes later, when the animation is committed:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[NSTaggedPointerString _getPoints:]: unrecognized selector sent to instance'

-[CASpringAnimation _copyRenderAnimationForLayer:]
CA::Layer::commit_animations(...)
_UIApplicationFlushCATransaction

Because it throws at commit time rather than at the call site, the crash lands on whatever frame comes next — which makes it look unrelated to the animation that caused it.

Every other curve value is a real CAMediaTimingFunction, so only 'spring' is affected. This is fork-specific: the curve === 'spring' ? CASpringAnimation : CABasicAnimation branch does not exist upstream.

Testing

Reproduced in an app that animates a slider thumb with curve: 'spring': consistent SIGABRT at the next CoreAnimation commit, matching the trace above. With this change the spring animation runs and the crash is gone.

CASpringAnimation still gets its damping, duration, fromValue and toValue as before — only the bogus timingFunction assignment is skipped.

@farfromrefug
farfromrefug marked this pull request as ready for review September 4, 2026 19:43
`curve === 'spring'` selects CASpringAnimation, then fell through to
`basicAnimation.timingFunction = curve` and put the string 'spring' where
CoreAnimation expects a CAMediaTimingFunction. The assignment is silent; the app
aborts at the next CA commit, inside -[CASpringAnimation _copyRenderAnimationForLayer:],
with `-[NSTaggedPointerString _getPoints:]: unrecognized selector sent to instance`.

Every other curve value is a real CAMediaTimingFunction, so only `curve: 'spring'`
was affected - any view animated with it crashed the app.

Co-Authored-By: Claude Opus 5 <[email protected]>
@farfromrefug
farfromrefug force-pushed the fix/ios-spring-timing-function branch from f87571a to 948de96 Compare September 4, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant