LocationManager
public final class LocationManager : NSObject
extension LocationManager: LocationProviderDelegate
An object responsible for notifying the map view about location-related events, such as a change in the device’s location.
-
Represents the latest location received from the location provider.
Declaration
Swift
public var latestLocation: Location? { get }
-
The object that acts as the delegate of the location manager.
Declaration
Swift
public weak var delegate: LocationPermissionsDelegate?
-
The current underlying location provider. Use
overrideLocationProvider(with:)
to substitute a different provider. Avoid manipulating the location provider directly. LocationManager assumes full responsibility for starting and stopping location and heading updates as needed.Declaration
Swift
public var locationProvider: LocationProvider! { get }
-
The set of objects that are currently consuming location updates. The returned object is a copy of the underlying one, so mutating it will have no effect.
Declaration
Swift
public var consumers: NSHashTable<LocationConsumer> { get }
-
Configuration options for the location manager.
Declaration
Swift
public var options: LocationOptions { get set }
-
Undocumented
Declaration
Swift
public func overrideLocationProvider(with customLocationProvider: LocationProvider)
-
The location manager holds weak references to consumers, client code should retain these references.
Declaration
Swift
public func addLocationConsumer(newConsumer consumer: LocationConsumer)
-
Removes a location consumer from the location manager.
Declaration
Swift
public func removeLocationConsumer(consumer: LocationConsumer)
-
Adds
PuckLocationConsumer
to the location manager.An instance of
PuckLocationConsumer
will get the accurate (interpolated) location of the puck as it moves, as opposed to theLocationConsumer
that gets updated only when theLocationProvider
has emitted a new location.Important
The location manager holds a weak reference to the consumer, thus client should retain these references.Declaration
Swift
public func addPuckLocationConsumer(_ consumer: PuckLocationConsumer)
-
Removes a
PuckLocationConsumer
from the location manager.Declaration
Swift
public func removePuckLocationConsumer(_ consumer: PuckLocationConsumer)
-
Allows a custom case to request full accuracy
Declaration
Swift
@available(iOS 14.0, *) public func requestTemporaryFullAccuracyPermissions(withPurposeKey purposeKey: String)