Panning Animations for IOS

Source: Internet
Author: User

In iOS development, the use of translation animation frequency is more and more high, give people feel is cool very smooth, play a role in enhancing the user experience. There are many ways to achieve animation in app development, but I am using more of the translation animation, and by the way also do some small summary, the great God can be ignored. For example: Click a button from the Controller interface to come up with a tableview, or click Tableviewcell to pop a view from the side. In fact, UIView animation is essentially a coreanimation package, providing a concise animation interface, we only need to set the starting coordinates and the end coordinates can be, as for the animation process can call UIView animation to do.

I'll post some sample code

Let's go first:

Well, after coming out, here's the code:

Two buttons above will not be written,

Go directly to the animation section.

After the object is created, lazy loading initializes the coordinates (starting position, my starting coordinates are negative screen widths) and cannot appear on the Controller's current interface:

Okay, now it's time to start calling animations.

Now the basic effect can be achieved, we need anything can be written in the view, for example, need a TableView words can write tableview in the view of the instantiation of the method

The next step is to see what you need and what you need to write in View.

What I'm writing is a tableview below to see. m file Configuration

Need to be reminded that, after inheriting the UIView, the equivalent of UIView is the parent view, can not write Self.view, can only write self (that is, representing the current object itself), in addition, lazy loading initialization, also need self (the current object to use) and then two more pictures

Without lazy loading, this is not a requirement, the underline is used directly.

Panning Animations for IOS

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.