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

Adding Action Selectors

You now have almost all the code changes needed to support swipes: The car table can move to the next or previous car, and both the iPhone and iPad car detail views can call the new method. The last new code is the selectors used by the swipe gestures.

All the work for the iPad selectors is done by nextOrPreviousCar:, which contains code for updating the state of the delegate—in this case, the iPad car detail view. Add the code in Listing 12-5 above the utility method #pragma in CarDetailViewController.m.

Listing 12-5 iPad Car Detail Swipe Gesture Recognizers

#pragma mark - Gestures - (IBAction)swipeCarRight:(UISwipeGestureRecognizer*)sender {               // 1     [self.delegate nextOrPreviousCar:YES];                                  // ...

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