TrckrDelegate
@objc
public protocol TrckrDelegate
This protocol defines the methods you should use in order to receive events and location updates from Trckr.
-
Tells the delegate that continuous location tracking started. This happens when the user starts moving.
Declaration
Swift
@objc optional func didStartTracking() -
Tells the delegate that continuous location tracking stopped. This happens when the user stops moving.
Declaration
Swift
@objc optional func didStopTracking() -
Tells the delegate that new location data is available.
Declaration
Swift
@objc optional func didUpdateLocations(_ locations: [CLLocation])Parameters
locationsthe new locations received and successfully filtered. Trckr uses
DesiredAccuracyto filter new locations and discards locations with low accuracy. -
Notifies the delegate when a region is crossed.
The crossed region can be identified by the
region.identifierwhich is eitherGeofence.RegionIdorBeacon.RegionId.Geofenceregions are automatically maintained by Trckr and you should not add or remove them yourself. Geofences are used as a trigger for (potentially) resuming continuous location tracking when the user starts moving.Beaconregions must be explicitely added by your app if you’d like to monitor beacons.This method is the first delegate method called when the user starts moving. Following this call,
didStartTrackingmay be called as well.Declaration
Swift
@objc optional func didCross(region: CLRegion, type: Geofence.RegionTriggerType, withinSchedule: Bool)Parameters
regionthe region crossed
typeone of
Geofence.GeofenceType, i.e. .Exit or .Entry. Note that for Geofence crossing only .Exit is supported.withinSchedulefalse if the current time is not within the scheduled tracking time. treu if the current time is within the schedule, or if no tracking schedule was set.
-
Asks the delegate whether tracking should occur outside the tracking schedule. This method is called only when
trackingScheduleis set on Trckr.Declaration
Swift
@objc optional func shouldTrackOutsideSchedule() -> Bool -
Notifies the delegate when the authorization status changed
Declaration
Swift
@objc optional func didChangeAuthorization(status: CLAuthorizationStatus)
TrckrDelegate Protocol Reference