domhofmann / PRTween

Lightweight tween library for iOS
BSD 2-Clause "Simplified" License
459 stars 63 forks source link

Linear damping #42

Open chris838 opened 10 years ago

chris838 commented 10 years ago

I've been playing around with linear damping as an alternative to the elastic tween timing functions. I have some code that is able to better mimic (I think) the iOS UIView spring animation:

https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/clm/UIView/animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:

Currently it is not a really timing function since the duration parameter is ignored. If the duration could be incorporated then I think this would come very close to how Apple implements their function internally.

rivera-ernesto commented 9 years ago

Included in https://github.com/PRTween/PRTween.