Adding the Swipe Gestures

You have written all the code for reacting to gestures. You now have a method for moving to the next or previous car, both car detail views can send the message, and there are selectors for the gestures.

The final step is to add the gestures and wire them in. You can do all this in the Storyboard editor for the iPhone and iPad. The steps are the same for either platform. The book shows iPhone and lets you update iPad for practice. Follow these steps:

1. Open Main_iPhone.storyboard.

2. Look for the Swipe gesture object in the Utilities area, or type Swipe into the Search area. Drag one into the bar below the View Car controller on the IB Canvas as shown in Figure 12-2. (The image uses a different search term to show all ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.