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

  • Home
  • SEARCH
  • 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 8130717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:49:33+00:00 2026-06-06T08:49:33+00:00

I have a UIView that I am rendering a UIBezierPath in based on touchesBegan

  • 0

I have a UIView that I am rendering a UIBezierPath in based on touchesBegan and touchesMoved. But I only want to draw in a certain area within the UIVIew. I would like to set up a CGRect within the UIView where touches are only registered. Any touches outside of this area will not be registered.

Ideally if the user drages outside of this rectangle, they can keep holding the touch, but the touchesBegan method will be called when they drag back into the area.

Can anyone help with this? 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-06-06T08:49:34+00:00Added an answer on June 6, 2026 at 8:49 am

    use pointInside:withEvent: to tell it to not accept the point if it is outside the area.

    - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
        return [self isPointWithinMyBounds:point];
    }
    
    - (BOOL) isPointWithinMyBounds:(CGPoint) point{
        //determine if the point is within the rect
        return NO;
    }
    

    the touchesMoved event will be the complex one. you would just discontinue drawing while outside the view.

    but that should accomplish your desired effect.

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

Sidebar

Related Questions

I have a UIView that updates based on data in a certain object. I'd
I have a UIView that contains a UIScrollView and I want to be able
I have a UIView subclass that draws itself when -drawRect: is called. It only
I have a UIView that I want to load when the user clicks a
Suppose I have a UIView that has some buttons and stuff, and I want
I have a UIView that will need to display two UITableViews, but they are
I have a UIView that allows the user to draw a line (myLine) on
I have a UIView animation (called by a touchesEnded: event) that I want to
I have a UIView that I draw a CGPath to and would like to
I have a UIView that I don't want to have a navigation bar. It

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.