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

The Archive Base Latest Questions

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

I want to track all user touches within a designated UIViewController subclass, e.g. MyViewController.

  • 0

I want to track all user touches within a designated UIViewController subclass, e.g. MyViewController.

As this UIViewController may contain UIKit-Elements, such as UIButtons, etc. I thought of lying a clear touch tracking UIView above the other views in MyViewController’s view.

Now I get touch events sent to the UIView, but I don’t know how to delegate the touches to the other subviews.

I already tried iterating over all MyViewController’s view subviews (except the touch tracking UIView) and sending them touchesBegan:withEvent:, touchesMoved:withEvent:, etc.

But this does not work for UICollectionViews.

What I basically need is tracking all touch events in MyViewController’s view frame.
MyViewController itself could inherit various other views that need to respond to touch events.

I also found here (http://stackoverflow.com/questions/8423174/detecting-all-touches-in-an-app) the idea to subclass UIWindow and to override sendEvent:
This would be possible in my case, but then I would have to enable/disable touch tracking whether MyViewController is visible or not.
Also I don’t know yet how to differentiate between touchesBegan:withEvent, touchesMoved:withEvent:, etc.

Thanks in advance.

Cheers,
tubtub

in MyViewController.m

- (void)loadView
{
    [super loadView];

    VETouchTrackingView *touchTrackingView;
    touchTrackingView = [[VETouchTrackingView alloc] initWithFrame:self.view.frame];
    touchTrackingView.userInteractionEnabled = YES;

    self.touchTrackingView = touchTrackingView;
    [self.view addSubview:self.touchTrackingView];
    [self.view bringSubviewToFront:self.touchTrackingView];
}
  • 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-16T23:46:51+00:00Added an answer on June 16, 2026 at 11:46 pm

    I managed to get the touch tracking I need by overriding sendEvent: in my UIWindow subclass.

    This works pretty nice.

    Here is the github project for anyone who also needs this: https://github.com/bhr/BHTouchTracking

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

Sidebar

Related Questions

I want to keep track of the user who creates and then updates all
Here is my problem, I want to track if user is online or offline
I am making an app i want to track the activity of the user.For
I have a mapview where I want to track the user's current location. GPS
I've been struggling with this all morning and I may be completely on the
I want to track user activity on site. I tried ActiveSupport::Notifications but hasn't user_id
In my app I want to keep a track of all the questions that
This is a hypothetical question: I want to build a Chrome extension that'll track
I want to display which all user is online (real time; like any chatting
I am designing an app that will keep track of all user's lat/long. For

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.