-
Notifications
You must be signed in to change notification settings - Fork 484
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
Feature: Timing functions #70
Conversation
Hi, Please update the readme examples. Also is there any example for using AnimationType.vector, how I change this to vector |
Good call @iTarek! I'll update the examples shortly. What you're looking for is: Both |
The AnimationType.vector is so confusing, I have icon on middle of screen and I was able to animate it to go down off screen like that.... Right now with AnimationType.vector the icon not start from the position it was before but it jumps to the new position and then move back, Is reversed: true working as it was before? |
@iTarek you're right. There's some odd behavior. The example app is working in the same way as before with UITableView and UICollectionView but I individual views have problems. I'll send a PR fixing this and adding examples shortly. In the meantime I recommend you switch back to the previous release |
Thank you for the quick response, I will wait for the next update 😊 |
@iTarek after some review I believe the functionality is working as expected. I agree the API is a bit confusing but I'm testing the example project and running this code: let animation = AnimationType.vector(CGVector(dx: 0, dy: 30))
activityIndicator.animate(animations: [animation], reversed: true, initialAlpha: 1, finalAlpha: 0) will effectively animate the view by moving it from its current position 30 points to the bottom. Can you maybe replicate the issue you're having on a PR or demo project? |
This PR adds support for Predefined Timing Functions. The library used the UIView animation API with springs which doesn't rely on timing functions.
To support this I had to remove. the default spring parameters so the method's signature would differ. Since this is a breaking change I also went ahead a replaced the
AnimationType.from(Direction, CGFloat)
case forAnimationType.vector(Vector)
.I'll keep this PR open for the weekend in case anybody wants to comment.