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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:22:03+00:00 2026-06-15T15:22:03+00:00

So I have 2 UIViews witch can draw a bezierpath and then returns the

  • 0

So I have 2 UIViews witch can draw a bezierpath and then returns the path. Then I need to check if the path contains a point I do this with help of [path containsPoint:currentObject.position]and it works for one of the views but not the other.
One view is on the top half of the iPhone and the other view is on the bottom half. The one on the bottom don’t work.
I tried to switch the views, and then it was the same problem, the bottom one doesn’t work.

Here is some code:

in mainviewcontroller:

-(void)didEndPath:(UIBezierPath *)path DrawView:(DrawView *)draw {
    if ([path containsPoint:currentObject.position]) {
        //do stuff
    }
}

and in drawview touches ended I do this:

[self.delegate didEndPath:currentPath DrawView:self];

Why doesn’t it work, can it be that the view has another origin then self.view? How do I fix it?

EDIT:

Okey, so I found the problem but not the solution.

If I change the touch methods in my UIView from this:
startPoint = [touch locationInView:self];to this startPoint = [touch locationInView:self.superview];then it reads the touches correctly but my path won’t draw. Still the problem is only with the bottom uiview. So how can I change so it returns a path with touches location in superview, but draws it within it self?

  • 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-15T15:22:05+00:00Added an answer on June 15, 2026 at 3:22 pm

    I solved the problem by making 2 paths. One with points from superview and one without. It works but i don’t know if its the best solution.

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

Sidebar

Related Questions

I have a problem with a UIView, hope you can help me. I have
I need to draw a simple graph, but I have no experience with custom
I have 2 UIViews both with a bit off code in them. I can
This may have been posted here somewhere but I can't find it. I am
I have a two UIViews filled with UIButtons. I want to only allow one
I have one (1) .xib with two UIViews, one on the top 1/3, the
I have a complex UIView with lots of custom subviews, and I need to
I have a custom subclass of UIView, LineDrawingView. I have this as a @property
I'm getting a bit confused with UIViews recently, I have been using them fine
I have been at this for quite some time now, reading tutorials and 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.