StandardLocationMonitor

@available(watchOS 3.0, *)
public class StandardLocationMonitor : BaseMonitor

A StandardLocationMonitor instance monitors the device for changes to its current location.

  • Encapsulates changes to the device’s current location.

    See more

    Declaration

    Swift

    public enum Event
  • Encapsulates information associated with a standard location monitor event.

    See more

    Declaration

    Swift

    public enum Info
  • Initializes a new StandardLocationMonitor.

    Declaration

    Swift

    public init(queue: OperationQueue,
                handler: @escaping (Event) -> Void)

    Parameters

    queue

    The operation queue on which the handler executes.

    handler

    The handler to call when the current location of the device changes.

  • The type of user activity associated with the location updates.

    Declaration

    Swift

    @available(watchOS 4.0, *)
    public var activityType: CLActivityType { get set }
  • A Boolean value indicating whether the app should receive location updates when suspended.

    Declaration

    Swift

    @available(watchOS 4.0, *)
    public var allowsBackgroundLocationUpdates: Bool { get set }
  • A Boolean value indicating whether the device supports deferred location updates.

    Declaration

    Swift

    public var canDeferUpdates: Bool { get }
  • The accuracy of the location data.

    Declaration

    Swift

    public var desiredAccuracy: CLLocationAccuracy { get set }
  • The minimum distance (measured in meters) the device must move horizontally before a location update is generated.

    Declaration

    Swift

    public var distanceFilter: CLLocationDistance { get set }
  • The most recently reported location.

    The value of this property is nil if location updates have never been initiated.

    Declaration

    Swift

    public var location: CLLocation? { get }
  • A Boolean value indicating whether location updates may be paused automatically.

    Declaration

    Swift

    public var pausesLocationUpdatesAutomatically: Bool { get set }
  • A Boolean indicating whether the status bar changes its appearance when location services are used in the background.

    Declaration

    Swift

    @available(iOS 11.0, *)
    public var showsBackgroundLocationIndicator: Bool { get set }
  • Defers the delivery of location updates until the specified criteria are met.

    Declaration

    Swift

    public func allowDeferredUpdates(untilTraveled distance: CLLocationDistance,
                                     timeout: TimeInterval)

    Parameters

    distance

    The distance (in meters) from the current location that must be traveled before location update delivery resumes.

    timeout

    The amount of time (in seconds) from the current time that must pass before location update delivery resumes.

  • Cancels the deferral of location updates.

    Declaration

    Swift

    public func disallowDeferredUpdates()
  • Requests the one-time delivery of the device’s current location.

    Declaration

    Swift

    public func requestLocation()
  • Declaration

    Swift

    override public func cleanupMonitor()
  • Declaration

    Swift

    override public func configureMonitor()