"We all love Paul Hegarty." Stanford IOS8 public class personal note animation animation

Source: Internet
Author: User

Animations in iOS are available in the following ways:

The first is to animate the elements of UIView.
The second is the animation of the controller, such as the use of the navigation controller described earlier.
The third is the core Animation, which is a very powerful framework, but beyond the scope of this course.
The fourth is the dynamic Animation, which is based on the physical characteristics of the device, such as shaking the phone, reversing the direction and so on.
To explain the first case:

Properties such as frame, transform, and Alpha can be animated.
You can call the UIView method to set the animation, the parameters of these methods have a closure to help us set the properties of UIView, the code in the closure is immediately executed when calling the method, and some methods have a closure with the parameter named completion, This closure can be set at the completion of the animation operation. For example, a declaration of the following methods:

Use the following:

MyView's transparency was originally 1, now we call the method Animatewithduration, only one operation in animations is to set the MyView to full transparency. The meaning of the first parameter 3.0 is that the transparent process will be completed in 3 seconds, the second parameter 2.0 meaning that the animation will delay 2S. The third parameter options are used in all animation methods, which is an enumeration that indicates different types of animations, which are described later.
Animations is what we need to do, completion is the completion of the operation, just see in the definition of the completion closure has a Boolean parameter, so the direct use of $ to replace the previous code execution is complete, In this closure, you want to remove the MyView from the parent view collection, so that you can actually delete it.
In addition to using Animatewithduration to modify the properties of the view, if you want to implement animations such as flipping, depending on the above three properties is not possible, there are special methods to choose:

Examples of Use:

If you need to change the view hierarchy, use the following method:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"We all love Paul Hegarty." Stanford IOS8 public class personal note animation animation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.