PFPolygon
Objective-C
@interface PFPolygon : NSObject <NSCopying, NSCoding>
Swift
class PFPolygon : NSObject, NSCopying, NSCoding
PFPolygon may be used to embed a latitude / longitude points as the value for a key in a PFObject.
It could be used to perform queries in a geospatial manner using PFQuery..
-
Creates a new
PFPolygonobject for the givenCLLocation, set to the location’s coordinates.Declaration
Objective-C
+ (nonnull instancetype)polygonWithCoordinates:(nonnull NSArray *)coordinates;Swift
convenience init(coordinates: [Any])Parameters
coordinatesArray of
CLLocation,PFGeoPointor(lat,lng)Return Value
Returns a new PFPolygon at specified location.
-
Test if this polygon contains a point
Declaration
Objective-C
- (BOOL)containsPoint:(nonnull PFGeoPoint *)point;Swift
func contains(_ point: PFGeoPoint) -> BoolParameters
pointPFGeoPointto testReturn Value
Returns a boolean.
-
Array of
PFGeoPointsor CLLocationsDeclaration
Objective-C
@property (nonatomic, strong) NSArray *_Nonnull coordinates;Swift
var coordinates: [Any] { get set }
View on GitHub
Install in Dash