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 ...

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.