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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:56:04+00:00 2026-06-10T21:56:04+00:00

hi i am observing something weird in iOS custom views, where i have a

  • 0

hi i am observing something weird in iOS custom views, where i have a button in side a custom view, i am looking for documentation or your answer to explain why i have this observation

i have a custom view (subclass of UIView), it contains a simple button, i bind the button touch event via addTarget:Action with UITouchUpInside, i just bind it selector to a simple method that NSLog a message

if you display the custom view and hits the button, you can see the message in the console, everything works as expected.

However, if you add a UIGestureReognizer to the custom view, and run it, when you click the button, it no longer prints the message, WHY???
i did more in depth investigation, and by looking at the hittest method IN THE CUSTOM VIEW (the view contains the button) (i override it, but i didn’t do anything, i just call super again), the hittest is returning the correct view, i.e. when i click on the button, hittest method of the custom view is returning UIButton

i do not understand the event chain here, can someone pointing the documentation that explains this?

it seems to me when you add the regonizer to the container view of the button, for some reason, the button DOES NOT KNOW how to handle the event, so it asks its superview (custom view in thsi case) to handle it, but why?? i already bind the event handeler to the button via UITouchUPInside

please please help i want to understand this

  • 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-10T21:56:06+00:00Added an answer on June 10, 2026 at 9:56 pm

    Set your recognizer’s cancelsTouchesInView property to NO.

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

Sidebar

Related Questions

We are observing 4-6 threads on Windows 7 x64 in the application which have
According to Hibernate documentation : After observing that arrays cannot be lazy , you
I have a dataset with ~20M rows and I'm observing the following behavior. The
I am making a web application. I have gotten a weird error with update
I am observing, on both Firefox and IE, that if I have a cookie
I'm practicing with the Key Value Observing, but it's something I do not quite
I have several dataSources I use for one UIViewController. My view controller uses KeyValue
I'am using key-value observing. I have object_1 (NSManagedObject) and few other objects-observers. When I
I have an architectural question. I have a project that is conceptually something like
We have an Elmah configured to send error notification emails to us whenever something

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.