Reputation: 81
I want to draw Polygon using n number of coordinate (But don't want to use MKPolygon bcz I don't have any Map view just doing all this programmatically). And also want to check if my current location is in Polygon. I want this to be done in Swift 3.
Thanks!
Upvotes: 1
Views: 448
Reputation: 19782
UIBezierPath will draw simple polygons (among other shapes), and has a convenient contains() function to check wether a point is inside the area of the path.
https://developer.apple.com/documentation/uikit/uibezierpath?changes=latest_minor
Upvotes: 2