قالب وردپرس درنا توس
Home / IOS Development / Advanced animations with UIViewPropertyAnimator | AppCoda

Advanced animations with UIViewPropertyAnimator | AppCoda



Animations are cool. They are an important part of the guidelines for iOS Human Interface. Animations help you draw the user's attention to important things, or just add some fun to your app.

There are few ways to implement animations on iOS. Probably the most popular one is UIView.animate (withDuration: animations :) . You can animate the display layer with CABasicAnimation . Also, UIKit allows you to customize the animation of display controls presentation with UIViewControllerTransitionDelegate .

In this tutorial I will discuss with you another exciting way to animate your views on UIViewPropertyAnimator . This class gives you much more control than its predecessor UIView.animate . With it, you can build custom timing, interactive and interruptible animations. Furthermore, you can change the animator on the fly.

Sound confusing? No worries. You understand in awhile.

Beginning with UIViewPropertyAnimator

UIViewPropertyAnimator was introduced in IOS 1

0. It allows you to create object-oriented animations. Let's have a sample animation created using UIViewPropertyAnimator .

How to do it with UIView.