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

    locations

    the new locations received and successfully filtered. Trckr uses DesiredAccuracy to 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.identifier which is either Geofence.RegionId or Beacon.RegionId.

    Geofence regions 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.

    Beacon regions 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, didStartTracking may be called as well.

    Declaration

    Swift

    @objc
    optional func didCross(region: CLRegion, type: Geofence.RegionTriggerType, withinSchedule: Bool)

    Parameters

    region

    the region crossed

    type

    one of Geofence.GeofenceType, i.e. .Exit or .Entry. Note that for Geofence crossing only .Exit is supported.

    withinSchedule

    false 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 trackingSchedule is 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)