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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:50:11+00:00 2026-05-28T17:50:11+00:00

I have been looking for a solution, and haven’t been lucky to find one.

  • 0

I have been looking for a solution, and haven’t been lucky to find one. If it has been asked before, mayboe some one can point it out, or help me with an idea.

I have UIViewController that hosts tow custom views. The first custom view is full screen. The second custom view, is actually is a menu that slides into the view from the bottom of the screen, similar to a toolbar with custom animation, and then it should slides out.

Current confirguation: the menu slides into the view after a delay (after view appears), and a NSTimer starts counting. It remains in the view for few seconds, until the NSTimer fires another method, and that method retracts the menu back.

Everything works fine.

What I want: If user starts interacting with the menu, toggling switches, slider, etc, I want the menu to stay in the view, delaying the firing of NSTimer, until user is done interacting. Then retract the menu.

To accomplish this, I used a NSTimer in the method that slides the menu into the view, to fire the other method that retracts the menu after X msec.

In the method that retracts the menu, I invalidate the timer.

I overrode the tocuhesBegan method, to see if the area of interaction falls within the boundries of the menu, if so, the NSTimer is resetted for another X msec.

Problem: If user touches the background of the menu, it is fine, but if user interacts with switches, buttons and slides within the menu, the menu.view does not register touches, which makes sense, because they are the front line and exhaust the touch event, so the touch event does not get passed down the hierarchy. But on the other hand, that is my problem!!

I can’t override every touchesBegan method in every element in the menu.view. How else can I register for those touches that are happening in the area of the menu.view?

I tried locationInView:nil to get touches within the window, but that dosen’t register interactions with buttons and sliders, etc, either.

Thanks.

  • 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-05-28T17:50:12+00:00Added an answer on May 28, 2026 at 5:50 pm

    One solution to capture all touch events wherever they occur in your view hierarchy is to provide a custom UIWindow implementation and override the sendEvent method. All events are received by the UIApplication first then dispatched to UIWindow before being dispatched to the UIView containing the touch point. By catching the events at the UIWindow level you ensure that you can intercept every event without having to override each control.

    Create a custom UIWindow class and implement sendEvent like this:

    - (void)sendEvent:(UIEvent *)event 
    {
        // Notify app to reset menu timer
        // ...
    
        [super sendEvent:event];
    }
    

    To use your custom UIWindow instead of the vanilla one depends on how your UI is implemented. If you are using Storyboards then you need to implement a window getter method on your app delegate like this:

    - (UIWindow*)window
    {
        if (!_window) {
            _window = [[CustomWindow alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
        }
    
        return _window;
    }
    

    Otherwise create an instance of your custom UIWindow instead of the standard one in your app delegate’s application:didFinishLaunchingWithOptions: method.

    You have several options for receiving the notification of touch events. You could use NSNotificationCenter to send and subscribe to a custom notification or you could implement a delegate property on your custom UIWindow and set your UIViewController as the delegate to receive notifications of touch events.

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

Sidebar

Related Questions

I have been looking for that so much and I haven't found the solution.
I've been looking around for a solution to this, but haven't quite found one.
I have been looking long for a solution how to pass the value from
Hi i have been looking for some solutions but i have found nothing... Is
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been looking online to find documentation for the function in QTP and
I have been looking into AWS spot instances for some jobs however instead of
I have been looking into backbone.js and I can't seem to figure out how
So far I haven't been able to find any solution that would allow me
I've been looking to find a CLEAN solution to completely and ultimately remove Visual

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.