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

Preventing Recognizers from Working

The iPad occasionally shows a car detail view with no information and disables interacting with any of the buttons, fields, or the picker. It does not disable the swipes. They do work, but the behavior might be unexpected.

You can disable recognizers in two ways. The first is to set a recognizer’s enabled property to NO. Doing so requires a reference to the gesture. A second way is to set a gesture delegate and implement gestureRecognizer:shouldReceiveTouch:, as follows:

1. Open Main_iPad.storyboard and set the delegate for the swipe gestures to CarDetailViewController. You can do this by Ctrl-clicking a gesture recognizer and dragging a connection from the delegate outlet to the controller.

2. Open CarDetailViewController.m ...

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