Geofence

public class Geofence : NSObject

A client for monitoring circular (geographic) regions.

A geographical region is an area defined by a circle of a specified radius around a known point on the Earth’s surface.

Geofence class is used internally by Trckr for monitoring when the user resumes movement. While the user is moving, Trckr receives continuous location updates from CoreLocation. When the user stops moving, a geofence region is added with Geofence.RegionId as its identifier and an .Exit trigger. When the user exists the geofenced region, continuous location updates are resumed.

In iOS, regions associated with your app are tracked at all times, including when the app isn’t running, and are very power efficient since the hardware required to monitor them is already used by other services - WiFi and Cellular signal. Monitoring geofence regions allows Trckr to track the user’s location even when your app isn’t running.

You should not use Geofence class directly.

  • The one and only Geofence client instance.

    Declaration

    Swift

    @objc
    public static let shared: Geofence
  • This is the default identifier used internally by Trckr to monitor circular (geographic) regions

    Declaration

    Swift

    public static let RegionId: String
  • The type of trigger for a monitroed region

    See more

    Declaration

    Swift

    @objc
    public enum RegionTriggerType : Int
  • Declaration

    Swift

    public func monitoredRegion(identifier: String = Geofence.RegionId) -> CLRegion?

    Return Value

    the monitored region with identifier, or nil if no such region exists.