SPGeofenceEvent
Objective-C
@interface SPGeofenceEvent : NSObject
Swift
class SPGeofenceEvent : NSObject
Contains information about a triggered geofence event.
-
Recommended constructor for SPGeofenceEvent objects
Declaration
Objective-C
- (nonnull instancetype) initWithLocation:(nullable SPLocation *)location geofences:(nonnull NSArray<SPGeofenceInfo *> *)geofences transition:(SPGeofenceTransitionOptions)transition errorCode:(NSInteger)code;
Swift
init(location: SPLocation?, geofences: [SPGeofenceInfo], transition: SPGeofenceTransitionOptions = [], errorCode code: Int)
Parameters
location
that triggered this event
geofences
list of geofences that were triggered
transition
the transition that caused an event to trigger
code
error code
Return Value
new instance of SPGeofenceEvent
-
Location that triggered the event.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) SPLocation *location;
Swift
unowned(unsafe) var location: SPLocation? { get }
-
List of geofences that were triggered.
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSArray<SPGeofenceInfo *> *_Nonnull geofences;
Swift
var geofences: [SPGeofenceInfo] { get }
-
Error code if there was an error.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger errorCode;
Swift
var errorCode: Int { get }
-
Transition that caused the event to trigger.
Declaration
Objective-C
@property (nonatomic, readonly) SPGeofenceTransitionOptions transition;
Swift
var transition: SPGeofenceTransitionOptions { get }