Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:23:57+00:00 2026-05-25T03:23:57+00:00

I started off naming my selector methods generically based on a description of the

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:23:58+00:00Added an answer on May 25, 2026 at 3:23 am

    I also went through an exploratory process and settled on (just one man’s opinion):

    1. Use a descriptor of what the gesture accomplishes as the verb. This lets you distinguish between multiple handlers for the same gesture type being used for different (semantic) actions.
    2. Suffix the method name with “Gesture”
    3. Always use the selector form that takes the recognizer parameter, and use the specific subclass type in the signature.

    Format:

    - (void)thingItAccomplishesGesture:(UISpecificGestureRecognizer *)recognizer;
    

    Example: a tap gesture recognizer that opens a document, I’d call it:

    - (void)openDocumentGesture:(UITapGestureRecognizer *)recognizer;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning elastic mapreduce and started off with the Word Splitter example provided
I have a portfolio made in C#/ASP.NET which started off small but, as it
I started off with the notepad example on the android website. What I did
i have created and ipad application. i started off with window based application and
I started off with Xalan for C++, but that really seemed like overkill for
I started off naming my jQuery objects like $this . Then, I decided I
I started off programming in Basic on the ZX81 , then BASICA , GW-BASIC
I started off by drafting a question: What is the best way to perform
None of us started off as experts (and most of us still aren't). Sure,
How can I draw a NSString centered within a NSRect ? I've started off

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.