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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:33:07+00:00 2026-06-04T08:33:07+00:00

Setup: I have parent view A. It has a child view B. B is

  • 0

Setup: I have parent view A. It has a child view B. B is partially inside the bounds of A, but partially outside (A has clipsToBounds=false). I have attached UITapGestureRecognizer (UITGR) to B.

Observed: UITGR fires OK when I tap on the portion of B that is within the bounds of A. UITGR does NOT fire when I tap on the portion of B that is outside the bounds of A.

Expected/question: How do I make UITGR fire when I tap on the portion of B that is outside the bounds of A?

  • 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-04T08:33:09+00:00Added an answer on June 4, 2026 at 8:33 am

    This quote will answer your question as to why it behaves like that:

    Touch events. The window object uses hit-testing and the responder chain to find the view to receive the touch event. In hit-testing, a window calls hitTest:withEvent: on the top-most view of the view hierarchy; this method proceeds by recursively calling pointInside:withEvent: on each view in the view hierarchy that returns YES, proceeding down the hierarchy until it finds the subview within whose bounds the touch took place. That view becomes the hit-test view.
    (source)

    One workaround is to create your own UITapInSubviewsView with the following definition for hitTest:

    (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
        NSEnumerator *reverseE = [self.subviews reverseObjectEnumerator];
        UIView *iSubView;
        while ((iSubView = [reverseE nextObject])) {
    
            UIView *viewWasHit = [iSubView hitTest:[self convertPoint:point toView:iSubView] withEvent:event];
            if(viewWasHit)
               return viewWasHit;
         }
         return [super hitTest:point withEvent:event];
    }
    

    Then you use this class for your parent view.

    (I found this code in a post from S.O. a few weeks ago, but I cannot seem to find it anymore; so just copied it from my project).

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

Sidebar

Related Questions

I have a parent-child view model object structure set up and need to update
I have a parent-child relationship setup that is fairly basic. The end result is
So I have a set up similar to this questions: Parent Child Setup Everything
One of my UIViewController has several child view controllers. They are built inside the
How would I setup my controls for the following situation?: I have a parent-container
I have parent/child relationship set up via Node Reference. A Child record can have
If I have entities set up for Parent - Child - Grandchild and one
Setup: I have a COM DLL that calls a method inside a managed C#
Setup: I have a UITextView inside a UITableViewCell 's contentView . I want it
I have the following View setup in one of my Activities: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/photoLayout

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.