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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:07:03+00:00 2026-05-24T19:07:03+00:00

In my app I have an array of points which have been added by

  • 0

In my app I have an array of points which have been added by the user and I want to be able to create a filled shape from these points.

I also want to be able to get any taps within the shape (not the rectangular frame of the shape but the actual shape itself). Also, if the tap is not within the shape (but possibly still within the shape’s frame), I want the tap to be ‘passed down’ to a shape underneath if there is one.

In a sense, I am trying to create an irregularly shaped UIButton from an array of points.

  • 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-24T19:07:04+00:00Added an answer on May 24, 2026 at 7:07 pm
    1. Create a subclass of UIView.
    2. In it, create a UIBezierPath property from the points array (moveToPoint: and addLineToPoint:).
    3. In drawRect:, use the bezier path to draw the shape (call fill or stroke or both).
    4. For hit testing, override pointInside:withEvent: and return the correct value based on the return value of -[UIBezierPath containsPoint:].

    Make sure to convert correctly between the view’s and path’s coordinate systems if they differ from each other.

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

Sidebar

Related Questions

I have the following array response from a server to an android app. [
I have made an app that gets an array of addresses from a web
Hello i have a app which makes 3 wheels from 3 different arrays of
I have an array of users in my app delegate, and in one of
I have an app holding an array of instances of a class called SwimmingPool.
Please have a look at this validation array in my cakephp app for model
I have an array of point data (for particles) which constantly changes size. To
I have a method which returns an NSArray with points to be plotted. Following
I have a script in app/vendors/shells which is executed periodically via cron. In that
I have a pretty weird problem in my iPhone app which is, I think,

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.