Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming
by Maurice Sharp, Erica Sadun, Rod Strougo
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]; // ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access