John-Lluch/SWRevealViewController — pull request #194 by robbiehanson (2014-02-12 20:45:14+00:00)
Title: The gestureRecognizers should not be automatically added to the frontView

I understand the desire to have a "good default behavior", but the current solution comes at the expense of confusion and inconsistency. I will argue that the alternative is more consistent and understandable:

_Why the gestureRecognizers should not be automatically added to the frontView:_

First, this is not something one would expect to happen by simply invoking a method to get a gestureRecognizer, comments notwithstanding. Second, the gestureRecognizers are not automatically added to *all* frontViews. Only the current frontView at the time the method is first called. This leads to confusion, as developers might wonder why the gestureRecognizers stop working when they set a different frontViewController. Additionally, if the developer does not want to add the gestureRecognizers to the frontView, then there is no way to fetch the gestureRecognizers without having them get added. This forces the developer to fetch the gestureRecognizers, and then immediately turn around and remove them from the frontView. Ultimately not adding them by default provides a more consistent routine: fetch the gestureRecognizer(s) and add them to every place I want, most often in viewDidLoad.

One of the things I like about this library is that it doesn't try to do everything. It does exactly what one would expect, and then explains what developers need to do themselves in order to get features Y & Z. However, I feel that the default gestureRecognizer behavior is in violation of this principle that otherwise permeates the framework. Providing a gestureRecognizer (and delegates), and then telling developers to properly add them where needed seems, to me, more in line with the work as a whole.