Animate UIView horizontally using UIDynamicAnimator

最后都变了- 提交于 2019-11-30 16:09:30

As it turns out, using UIDynamicAnimator, and all other dynamic animations was not needed. All I needed was the animateWithDuration:delay:usingSpringWithDamping: initialSpringVelocity: options: animations: completion: class method. Just use it in place of any simple animateWithDuration: method, and it yields the exact behaviour i intended to achieve.

Sample code:

    [UIView animateWithDuration:0.4
                          delay:0
         usingSpringWithDamping:0.5
          initialSpringVelocity:0.5
                        options:0
                     animations:^{

                         //Animation code

                     } completion:nil];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!