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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:09:53+00:00 2026-06-07T13:09:53+00:00

This is an odd scenario, but I have two overlapping UIViews, and I need

  • 0

This is an odd scenario, but I have two overlapping UIViews, and I need to display one above the other, but give the lower one precedence on receiving input. If that makes any sense. I can clarify if needed.

Preferably I would like to do this in Interface Builder, but assuming that is not possible, is there a way to do it programmatically?

Edit: Got it working, thanks to @jaydee3. Just override the hitTest: method of UIView1 as follows. UIView2 is self.otherView.

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    if (self.otherView && [self.otherView pointInside:[self.otherView convertPoint:point fromView:self] withEvent:event])
    {
        return [self.otherView hitTest:[self.otherView convertPoint:point fromView:self] withEvent:event];
    }

    return [super hitTest:point withEvent:event];
}
  • 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-07T13:09:56+00:00Added an answer on June 7, 2026 at 1:09 pm

    In case you don’t need input on view1, just set view1.userInteractionEnabled = NO. This can be done in IB.

    Otherwise, you have to use some code. Eg. subclass UIView for the view1 and override the hitTest: … method. If the touched point is overlapping with the other view, return [view2 hitTest: …].

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

Sidebar

Related Questions

This might sound like an odd scenario, but I've got two forms on one
I have an odd scenario (see this answer for more details), where I need
An odd question this will be, but here goes. I have a page on
IE6 is always surprising me but this one is REALLY odd. I'm creating a
I have been banging my head against the wall with this odd behaviour on
This is odd. I have a Default.png, Default-Landscape.png, Default-Portrait.png and Default@2x.png. The normal default
So, this is odd. In my makefile I have CC:=icc ifeq ($(CC),icc) CFLAGS :=
I just started C++ but have some prior knowledge to other languages (vb awhile
I have a rather odd scenario here, hoping someone might have some insight. I
slightly odd scenario. I have RequiresQuestionAndAnswer set to false because the admin needs to

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.