DefaultCLLocationProvider
public class DefaultCLLocationProvider : NSObject, ValidatingLocationProvider
Implementation of LocationProvider that uses CLLocationManager as a GPS source provider.
Provides location updates and manages location-related services.
This class is responsible for providing GPS location updates using the CLLocationManager.
The class includes:
- enable location and disable location updates
- manage observers and
validate location updates.
Important
This is a Public Preview API. It may be changed or removed at any time.
-
DefaultCLLocationProvider convenience initializer. Initializes the provider with an optional location validation policy.
This initializer allows the creation of a
DefaultCLLocationProviderinstance with a custom location validation policy. If no custom policy is provided, a default validation policy is used.Declaration
Swift
convenience public init( locationValidationPolicy: LocationUpdateValidator? = nil )Parameters
locationValidationPolicyPolicy for validating incoming location updates, defined by
LocationUpdateValidatorprotocol. Default isnil.
-
The last known location provided by the
CLLocationManager.Declaration
Swift
public var lastKnownLocation: GeoLocation? -
Policy for validating incoming location updates.
Declaration
Swift
public var validationPolicy: LocationUpdateValidator -
Starts the process of updating locations and headings.
This method starts the
CLLocationManagerto begin receiving location and heading updates. It checks the authorization status and starts the updates only if authorized. The last known location is used, if available.Declaration
Swift
public func enable() -
Stops the process of updating locations and headings.
This method stops the
CLLocationManagerfrom receiving location and heading updates. It sets therunningflag tofalse.Declaration
Swift
public func disable() -
Add an observer to receive location update notifications.
Declaration
Swift
public func addObserver(_ observer: LocationUpdateObserver)Parameters
observerThe observer to be added.
-
Remove an observer from receiving location update notifications.
Declaration
Swift
public func removeObserver(_ observer: LocationUpdateObserver)Parameters
observerThe observer to be removed.
TomTom SDK for iOS (0.71.1)
DefaultCLLocationProvider