Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

15. Graphics and Animations > 15.13. Animating and Moving Views

15.13. Animating and Moving Views

Problem

You want to animate the displacement of views.

Solution

Use the animation methods of UIView while displacing your views.

Discussion

There are various ways of performing animations in iOS: capabilities are provided at a relatively low level, but also at a higher level. The highest level we can get is through UIKit, which is what we will be discussing in this section. UIKit includes some low-level Core Animation functionalities and presents us with a really clean API to work with.

The starting point for performing animations in UIKit is to call the beginAnimations:context: class method of the UIView class. Its first parameter is an optional name that you choose for your animation, and the second is an optional context that you can retrieve later to pass to delegate methods of the animations. We will talk about these shortly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial