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
PFPolygon
object for the givenCLLocation
, set to the location’s coordinates.Declaration
Objective-C
+ (nonnull instancetype)polygonWithCoordinates:(nonnull NSArray *)coordinates;
Swift
convenience init(coordinates: [Any])
Parameters
coordinates
Array of
CLLocation
,PFGeoPoint
or(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) -> Bool
Parameters
point
PFGeoPoint
to testReturn Value
Returns a boolean.
-
Array of
PFGeoPoints
or CLLocationsDeclaration
Objective-C
@property (nonatomic, strong) NSArray *_Nonnull coordinates;
Swift
var coordinates: [Any] { get set }