Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Spring animations now take velocity into account when determining duration. #56

Merged
merged 4 commits into from
Nov 22, 2017

Conversation

jverkoey
Copy link
Contributor

Prior to this change, spring animations were calculating their settling time prior to having set their initial velocity.

After this change, spring animations will calculate their settling time after having set the initial velocity.

Jeff Verkoeyen added 2 commits November 21, 2017 13:28
…ation.

Prior to this change, spring animations were calculating their settling time prior to having set their initial velocity.

After this change, spring animations will calculate their settling time after having set the initial velocity.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
if ([animation isKindOfClass:[CASpringAnimation class]]) {
CASpringAnimation *springAnimation = (CASpringAnimation *)animation;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is referencing the class before it was introduced OK? I believe CASpringAnimation was introduced in iOS 9?
https://developer.apple.com/documentation/quartzcore/caspringanimation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly an encouraged behavior, no. But this allows us to expand our min SDK support to iOS 8. Is a trade-off, but a relatively safe one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. As long as it doesn't crash with undefined symbols (or generate compiler errors). Sounds good to me.

@jverkoey jverkoey merged commit a8a40ea into develop Nov 22, 2017
@jverkoey jverkoey deleted the settling branch November 22, 2017 17:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants