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

Does the ability to apply animations immediately exist? #8

Closed
ymkim50 opened this issue Feb 27, 2017 · 6 comments
Closed

Does the ability to apply animations immediately exist? #8

ymkim50 opened this issue Feb 27, 2017 · 6 comments

Comments

@ymkim50
Copy link

ymkim50 commented Feb 27, 2017

I expected the transform to be applied when I applied .duration (0.0) in the motion (...) function, but it did not.

The animation application I want is as follows.

Cell.transform = CGAffineTransform (scaleX: 0, y: 0)
Cell.motion ([. Scale (1), .duration (defaultTimeInterval), .timingFunction (.easeOut)])

I applied the first line to cell.motion (.scale (0), .duration (0)), but internally it seems that the default of duration applies.

If .duration (0), can the transform be applied immediately?

I always appreciate quick answers.

@daniel-jonathan daniel-jonathan self-assigned this Feb 28, 2017
@daniel-jonathan
Copy link
Member

When you set the value of 0 as the duration, I believe it tells CAAnimation to use the default value. So the idea would be to set the duration to a really small value, such as 0.01. That will be so fast that it will effectively be immediate. For example:

fabButton.motion(.scale(2), .duration(0.01), .timingFunction(.easeOut))

All the best :)

@ymkim50
Copy link
Author

ymkim50 commented Mar 1, 2017

I confirmed that it works by the method I have given.

However, this approach can be confusing, so please consider supporting .duration (0).

Thank you for your reply.

@daniel-jonathan
Copy link
Member

I am going to add this as a feature request :) I agree with you.

@ymkim50
Copy link
Author

ymkim50 commented Mar 2, 2017

Thank you daniel!

@daniel-jonathan
Copy link
Member

This is now supported in the next release. Thank you!

@daniel-jonathan
Copy link
Member

The fix for this issue is in Motion 1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants