Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tween CAShapeLayer path? #25

Closed
theoriginalbit opened this issue Dec 22, 2019 · 2 comments
Closed

Tween CAShapeLayer path? #25

theoriginalbit opened this issue Dec 22, 2019 · 2 comments

Comments

@theoriginalbit
Copy link

Is it possible with this library to create an animation from one path value to another, like with CABasicAnimation, but unlike CABasicAnimation make it scrubbable?

@SteveBarnegren
Copy link
Owner

Hi @theoriginalbit.

It's certainly possible to drive this sort of animation with TweenKit. The difficulty is in finding some kind of 'handle' that can be exposed to TweenKit to actually apply the animation values.

eg. In this case, I'm not sure what self.someProperty would be, that would transition the path from one path to another.

let action = InterpolationAction(
                             from: fromRect,
                             to: toRect,
                             duration: 1.0,
                             easing: .exponentialInOut) {
                                    self.someProperty = $0
}

I don't know core animation well enough to be able to point you in the right direction I'm afraid. If such a feature exists that lets you hook in to the interpolated state between two paths, then you can certainly use TweenKit to drive it.

@theoriginalbit
Copy link
Author

Thanks for the reply @SteveBarnegren and happy holidays 🙂

The someProperty was the bit I was struggling with unfortunately, the CABasicAnimation makes it easy since you can just set path as the to and from without needing to know the in-between.

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

No branches or pull requests

2 participants