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 the Gesture Recognizer to the Current Detail

Any time any detail view except the default one is shown, the return gesture recognizer is added. And even if it is accidentally added to the default detail view, the worst that can happen is returning the app to the default state, showing that same detail view.

DetailController manages showing detail content, so it is the logical place to add the gesture recognizer. However, it is not the best controller for responding to a recognized gesture. Although DetailController manages the detail, it does not manage the overall state of the app. That is done by MainMenuViewController, so this is where the recognized gesture action method goes.

You need to make a few small additions to the .h file and ...

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