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

Step 3: Modifying CarDetailViewController

Very few changes are needed for this class. Follow these steps:

1. In the .h file, remove all references to ViewCarProtocol and delete the delegate declaration.

2. Add a declaration for the nextOrPrevious: block property:

@property (copy, nonatomic) void (^nextOrPreviousCar)(BOOL isNext);

3. In the .m file, use the new block in swipeCarRight: and swipeCarLeft:. Each call looks like this:

self.nextOrPreviousCar(<BooleanArgument>);

Replace BooleanArgument with either YES or NO, depending on the method.

All that remains is to update the iPad’s main car menu.

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