I started off naming my selector methods generically based on a description of the gesture itself but with the word “handle” in front. For example:
UITapGestureRecognizer *aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleOneFingerSingleTap:)];
But then I wanted different behavior (and different selector methods) for the same gesture in different views. Then I started naming my selector methods based on what I wanted to happen. For example:
UITapGestureRecognizer *aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleShowMyPopover:)];
However, I’m not sure that is going to make sense in the long run either. For one thing, the method name alone does not obviously indicate that it is a gesture recognizer selector. Or maybe the word “handle” indicates it is a selector method? Do I even need to worry about that?
So that is why I’m asking: to see if anyone has preferences (based on experience) for how they name their gesture recognizer selectors.
I searched the Coding Guidelines for Cocoa Naming Methods page but found nothing obvious.
Just in case it matters for this discussion, I create and assign gesture recognizers to views in the view controller, and the selector methods live in the view controller also.
I also went through an exploratory process and settled on (just one man’s opinion):
Format:
Example: a tap gesture recognizer that opens a document, I’d call it: