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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:26:42+00:00 2026-06-14T14:26:42+00:00

I have a simple iPhone app with a simple view and a custom view

  • 0

I have a simple iPhone app with a simple view and a custom view as a child. The child is just a square painted on the main view.

I need to track a touch event that enters this child view but from a touch that started outside the view.

What I’ve tried so far is to add the TouchesBegin/TouchesMoved events to the parent view. Also tried to add the to the child controls directly but that doesn’t track any touches that are not initiated within that control.

The questions are:

a) can I get the control from Position somehow?

b) is this the best way doing this, or is there another way?

Again, I include this video of GamePlay for the game I’m trying to port (on my spare time). It’s not a promotion attempt but illustrates what I’m trying to accomplish. I wrote the Win8 and WP7 version of the game so I’m not trying to copy another persons work here. 🙂 Don’t watch it if you don’t want to know what game it is. The question is still valid without watching this.

http://www.youtube.com/watch?v=13IczvA7Ipo

Thanks

// Johan

  • 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-14T14:26:43+00:00Added an answer on June 14, 2026 at 2:26 pm

    I stumbled on the answer myself. In the parent I override TouchesMoved (and Begin and Ended not shown here).

    I then iterate the subviews and chech if it’s the view I’m looking for by type and then check if the Frame contains the point. The code below is just concept of course.

        public override void TouchesMoved (NSSet touches, UIEvent evt)
        {
            base.TouchesMoved (touches, evt);
    
            UITouch touch = touches.AnyObject as UITouch;
    
            if (touch != null) {
                var rp = touch.LocationInView (touch.View);
    
                foreach(var sv in this.View.Subviews)
                {
                    if(!(sv is LetterControl))
                        continue;
    
                    if(sv.Frame.Contains (rp))
                    {
                        Console.WriteLine("LetterControl found");
                    }
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app that shows a simple view (View 1) that has
I currently have a simple iPhone app that loads a custom subclass of UIView.
I have a simple UI picker view in an iOS app (iPhone) and I'm
I have a very simple iPhone app that requires a random integer from 1-100.
I'm working on a very simple iPhone app, that in the end will have
I have a rather simple iPhone app consisting of numerous views containing a single,
I have a simple iPhone app based on a navigation controller. There are two
Have a simple iPhone app with a single UIViewController and two Views in one
I'm working on an iPhone app and would like to have a simple text
I have a simple iphone app that's based on the CrashLanding sample app. So

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.