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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:59:46+00:00 2026-06-16T18:59:46+00:00

In my app I have 2 transparent UIViewController layers. the first layer contain UIView

  • 0

In my app I have 2 transparent UIViewController layers.
the first layer contain UIView object that i am trying to recognize by touch with:

 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;

method.

the problem is,
there is an transparent UIViewController above it.

I have tried to implement touch event on the SeconedStackedViewController and to create an instance of FirstStackedViewController and call the same method from there. the methods are called, but the hit test not.

Code:

FirstStackedViewController *fsvc = [[FirstStackedViewController alloc]init];


- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
      [fsvc hitTest:point withEvent:event];
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
      fsvc = [[FirstStackedViewController alloc]init];
      [fsvc touchesEnded:touches withEvent:event];
}

How can I override this method to be called on the FirstStackedViewController?
if i will can simulate a touch on the FirstStackedViewController i think it will make the work

  • 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-16T18:59:47+00:00Added an answer on June 16, 2026 at 6:59 pm

    My first question is why you are pushing a transparent view controller. Might your needs be better served by layering a transparent view within the same controller?

    Without looking at your requirements, it’s hard to say for sure, but most likely this is more in accord with the usual separation of logic: you have a need for code that can receive input from one view and pass it to other logic. It has need to know about the internals of both, and therefore is a good candidate for a controller object with the knowledge needed to accomplish your task.

    In this case, you would have no trouble at all – just present your transparent view, and pass touches to whatever action you wish.

    But there are good reasons to do a VC with a transparent view. To access the VC beneath you, you can as another responder said access the app delegate. I’d keep the app delegate out of it, and just access self.navController.viewControllers. This array represents the stack of VCs. Then iterate downward – the one ‘below’ you is the one you want to relay the message to.

    Most likely rather than using isMemberOfClass you’d want to define a protocol and check whether the VC conformsToProtocol.

    for (int i=0; i < navBar.viewControllers.count ; i++) {
       UIViewController *current = navBar.viewControllers[i];
       if (current == self) {
          UIViewController *targetVC = navBar.viewControllers[i+1]; // make sure you're not over bounds - you could do this in the loop def'n.
          if ([targetVC class] conformsToProtocol("TransparentPassingActions")]) {
             // pass message
          }
       }
    }
    

    You can also just use indexOfObject to get the current VC, I suppose, and then look one lower. That gets rid of the loop.

    The pseudo-code in the previous answer confuses UIViews and UIViewControllers, by the way; perhaps this was clear to you. It is not possible to access view controllers by accessing views.

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

Sidebar

Related Questions

My app have a background image that fills the screen. I'd like to display
I have a little app that have by default youtube as homepage. You can
I have app in which i have recorded sound files i want that i
I have a theme in my app that defines a custom color for the
I have a small app that allows the user to draw on the screen
I have an AIR app initially written in Flex 3 that I had removed
I have an Android app that loads an image as a bitmap and displays
I have an app that can drag images anywhere in the view but my
I have a app that shows two polygons. I need to make progressively invisible
I have an ipad app, that as user does some actions, uitextfields and buttons,

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.