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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:53:37+00:00 2026-06-03T11:53:37+00:00

I have a view (let’s say View B) positioned on top of another view

  • 0

I have a view (let’s say View B) positioned on top of another view (View A). I would like to make some animation when a touch tap happens outside of view B.

So far I have attached taptouch gesture recognizer to View A. The problem is that View A is intercepting tap event even for the one that happens on view B (while it is overlapping View A).

UITapGestureRecognizer * recognizer = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(animateViewB)];
recognizer.delegate = self;
[self.viewA addGestureRecognizer:recognizer];

How should I proceed to make sure the tap events are not sent to View A when clicking inside View B? If I check the positioning of the event relatively to View B and if I detect it is inside it. How can I make sure all events are forwarded to View B?

  • 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-03T11:53:38+00:00Added an answer on June 3, 2026 at 11:53 am

    The reason your viewA was picking up the interaction even though you were touching viewB is that UIImageViews natively have user interaction disabled.

    If you want to intercept the interaction on a UIImageView you have to set:

    imageView.userInteractionEnabled = YES;
    

    If you add a gesture recognizer to a view that view will be the only one that uses the particular recognizer.

    The highest level view (i.e. the one on top) with its user interaction enabled will receive your touch or gesture. Views with user interaction disabled will not receive any touch or gesture events.

    For a better understanding of view hierarchy you should read: View Programming Guide for iOS

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

Sidebar

Related Questions

Let's say I have some classes like this: abstract class View(val writer: XMLStreamWriter) {
Let's say I have some view called My View. I know I can create
Requirement 1 Let's say I have some view model with two DateTime properties, Start
Let's say I have a view: def pony_view(request, arg1, arg2): ... Make ponies, etc
So let's say I have a view that access a date: <%= Html.TextBoxFor(model =>
Let's say I have 5 revisions of a README file. How do I view
Let's say I have a QTableView with a corresponding model. This view shows numbers
I have view stack in a app like so: <mx:ViewStack id=viewStack left=0 right=0 top=0
I have a tableview and a normal view (let's say view 2) inside a
Let's say I have this view model: public class MyModel { [Range(0, 999, ErrorMessage

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.