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