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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:04:56+00:00 2026-05-29T10:04:56+00:00

Imagine a view with, say, 4 subviews, next to each other but non overlapping.

  • 0

Imagine a view with, say, 4 subviews, next to each other but non overlapping.
Let’s call them view#1 … view#4

All 5 such views are my own UIView subclasses (yes, I’ve read: Event Handling as well as iOS Event Guide and this SO question and this one, not answered yet)

When the user touches one of them, UIKit “hiTests” it and delivers subsequent events to that view: view#1

Even when the finger goes outside view#1, over say view#3.

Even if this “drag” is now over view#3, view#1 still receives touchesMoved, but view#3 receives nothing.

I want view#3 to start replying to the touches. Maybe with a “touchedEntered” of my own, together with possibly a “touchesExited” on view#1.

How would I go about this?

I can see two approaches.

  1. side step the problem and do all the touch handling in the parent
    view whenever I detect a touchesMoved outside of view#1 bounds or,
  2. transfer to the parent view telling it to “redispatch”. Not very
    clear how such redispatching would work, though.

For solution #2 where I am getting confused is not about the forwarding per se, but how to find the UIVIew I want to forward to. I can obviously loop through the parent subviews until I find one whose bounds/frame contain the touch, but I am wondering if I am missing something, that Apple would have already provided but I cannot relate to this problem.

Any idea?

  • 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-29T10:04:56+00:00Added an answer on May 29, 2026 at 10:04 am

    I have done this, but I used CALayers instead of sub-UIViews. That way, there is no worries about the subviews catching/redispatching events to the parent UIView. You might not be able to do that, but it does simplify things. My solution tended to use CGRectContainsPoint() a lot.

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

Sidebar

Related Questions

Imagine you have a normal table view where each row is an item on
Let's say I have a PHP Model-View-Controller framework that maps an address like http://example.com/admin/posts/edit/5
Imagine a table view listing some recipes. Each time the user taps on a
ExtJS 4.1. Let's imagine we have some form: Ext.define('App.view.editform', { extend: 'Ext.form.Basic', defaultType: 'textfield',
Let's say we have a view controller with one sub view. the subview takes
Struts 2 will resolve all property names during view rendering against the top object
Imagine you have a secured site and a View that can be generated in
Hey folks, I have a question which feels stupid but I can't quite say
Lets imagine the scenario: UITabBarController - UITabBar - Tab 1: View Controller A -
I need to instantiate a new view on a command Imagine I have a

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.