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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:44:56+00:00 2026-05-11T11:44:56+00:00

Currently I see that a touch event will show me the UIView where the

  • 0

Currently I see that a touch event will show me the UIView where the touch occured. But what if I need to detect a touch of some non rectangular shape, like a circle. How would I go about doing something like that ?

Basically I want to do something only if the user touches somewhere within a circular area that’s not visible.

Any help/direction is appreciated, TIA!

  • 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. 2026-05-11T11:44:57+00:00Added an answer on May 11, 2026 at 11:44 am

    You would do it like so. Note that ‘locationInView’ will return the coordinates of the touch with respect to the specified view, so a touch in the top-left corner of a view will return (0,0) regardless of where that view is onscreen.

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event  {      UITouch *touch = [touches anyObject];    // gets the coordinats of the touch with respect to the specified view.    CGPoint touchPoint = [touch locationInView:self];    // test the coordinates however you wish,    ... } 

    To test against a sphere you would calculate the distance from the touch point to the center of the sphere, then check whether this was less than the sphere radius.

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

Sidebar

Related Questions

I'm currently working on a team that uses SASS. I see that we are
I'm currently playing with C, C++ and ASM. I can see that there's always
Currently we're using javascript new RegExp('#[^,#=!\s][^,#=!\s]*') (see [1]) and it mostly works, except that
I have a UIView animation (called by a touchesEnded: event) that I want to
i have developed a game that is currently running on iphone/ipad/ipod touch without any
I'm trying to basically to see if a file exists that has the current
Despite warnings to drop my present course of action, I currently see no better
I have this: As you can see I currently have a conditional to include
Currently Im have the following script which checks to see if a checkbox value
Currently my tableview looks like this: as you can see, cell.textLabel and cell.detailTextLable both

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.