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 8897981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:29:32+00:00 2026-06-15T00:29:32+00:00

I have a UIView with an UITapGestureRecognizer and on top I use textFields and

  • 0

I have a UIView with an UITapGestureRecognizer and on top I use textFields and checkboxes. I want to use this gestureRecongizer to remove the keyboard by clicking anywhere else.

But know my checkboxes call the selector of the recongizer?
How can I avoid this behavior?I already tried the exclusiveTouch property but it didn’t work.

Anyone who can recommend me a good workflow for this problem?

  • 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-06-15T00:29:34+00:00Added an answer on June 15, 2026 at 12:29 am

    1- Register as your recognizer delegate tapRecognizer.delegate = self; (declare that you are UIGestureRecognizerDelegate)

    2- Implement shouldReceiveTouch

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    
    }
    

    3- Check the touch.view to decide if the gesture should take care of that touch. In you case, return NO if its the checkbox view.

     - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
        if ([touch.view isKindOfClass:[yourCheckboxClass class]]) {
        return NO; // ignore the touch
        }
        return YES;
        }
    

    (You dont have to use isKindOfClass, You can use any other way to determine if its your checkbox)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView subclass and I want the keyboard to appear when it
I have a UIView with UITableView component and I want to create a class
I have a UIView inside a UIView m and I want the inner UIView
I have a custom UIView , to which I have added a UITapGestureRecognizer to
I have a Background view (UIImageView) in that i am adding a view(UIView). this
(edited for clarity) I have a UITableView. On top of that is a UIView
I have custom UIView class GestureView. I have a forward declaration for this class
i have a custom UIView which is presented from a UIViewController . This view
I have a UIView with 4 buttons on it and another UIView on top
I have a UIView in which I added a UITapGestureRecognizer . Inside that view

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.