ios - Naming guidelines for the selector methods of gesture recognizers? -
I started to naming my selector methods generally based on the description of the genescope, but the words "word" in front with. For example:
UITapGestureRecognizer * aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget: auto-operation: @selector (handleOneFingerSingleTap :)]; But then I need different behavior (and different selector methods) for the same gesture in different ideas. Then I started naming my selective methods, which I wanted to do. For example: UITapGestureRecognizer * aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget: Self-action: @selector (handleShowMyPopover :)]; However, I'm not sure that seems long-term. For one thing, the name of the method alone does not clearly indicate that it is a signal identifier selector. Or maybe the word "handle" indicates that this is a selector method? Do I need to worry about it?
That's why I am asking: to see if anyone has the name of priority identifier selectors, P> I searched but could not find anything clear.
Just in this case it matters to the discussion, I create and assign views of the view controller to the identifier of the gesture, and selector methods also remain in view controller.
I also went through a search process and settled on bus (only one person's opinion) :
- The gesture has been completed in the form of a verb, use a descriptor about it, for this you can use the same signal type to be used for different (semantic) Allows to differentiate between handler.
- Suffer method name with "gesture"
- Always use selector form Identifier parameter, and use specific subclass type in signature.
Format:
- (zero) ObjectAutuplication Consensual: (UISpecificGestureRecognizer *) identifier; Example: A tap gesture identifier that opens a document, I call it: - (zero) OpenDidware: (UITapGestureRecognizer *) identifier;
Comments
Post a Comment