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

Chapter 8. Gestures and Touches > Recipe: Adding Undo Support

Recipe: Adding Undo Support

Undo support provides another important component of direct manipulation interfaces. For a simple GUI, this involves little more than returning each object to a previous onscreen position. Cocoa Touch offers the NSUndoManager class to provide a way to reverse user actions.

Creating an Undo Manager

By default, every application window provides a shared undo manager. You can use this shared manager or create your own. The easiest way to hook into the shared manager is to wait until the view has been presented in viewDidAppear: and then point a local instance variable to that shared manager:


  

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