O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and Responding to the Gesture Recognizer

All you have to do now is add the action method, create the gesture recognizer, and add it to the detail controller. Follow these steps:

1. Import ReturnGestureRecognizer.h into MainMenuViewController.m.

2. Add the code in Listing 12-10 below carViewDone:.

3. Update viewDidLoad to allocate a gesture recognizer and then set the detail controller’s returnGesture property. Add the following code to the end of the method:

ReturnGestureRecognizer *returnGesture = [[ReturnGestureRecognizer alloc]                                           initWithTarget:self                                           action:@selector(returnHome:)]; [DetailController sharedDetailController].returnGesture ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required