sprintWithDamping/initialSpringVelocity not working?
haemi opened this issue · comments
Stefan Walkner commented
Expected Behavior
when setting usingSpringWithDamping
and initialSpringVelocity
it seems as if they have no effect; no spring animation at all... Am I missing something?
Actual Behavior
E.g. the zoom animation is linear, the view grows - but now springin
Steps to Reproduce the Problem
- setting
usingSpringWithDamping
to e.g. 3, 0.3, ... - setting
initialSpringVelocity
to e.g. 5, 0.5, ... - there is no difference between setting in on configuration or directly with
UIView.animate
Specifications
- Version: 13
- Platform: iOS
Marcos Griselli commented
Hi @haemi, thanks for reporting this. I'll take a look at it in the upcoming days.
Marcos Griselli commented
@haemi, the springs are working as expected.
I'm using these values to create the animation below:
UIView.animate(
views: self.collectionView!.orderedVisibleCells,
animations: animations,
duration: 1.3,
usingSpringWithDamping: 0.45,
initialSpringVelocity: 10
)
Perhaps your animation uses the default duration
and it's to fast to appreciate the spring?
Also, keep in mind that usingSpringWithDamping
goes from 0 to 1.