LocationProvider
public protocol LocationProvider
The LocationProvider protocol defines a set of methods that a class must
implement in order to serve as the location events provider.
-
Configures the location provider.
Declaration
Swift
var locationProviderOptions: LocationOptions { get set } -
Returns the current localization authorization status.
Declaration
Swift
var authorizationStatus: CLAuthorizationStatus { get } -
Returns the current accuracy authorization that the user has granted. The default value is
CLAccuracyAuthorization.fullAccuracyon iOS versions prior to iOS 14.Declaration
Swift
var accuracyAuthorization: CLAccuracyAuthorization { get } -
Returns the latest heading update received, or
nilif none is available.Declaration
Swift
var heading: CLHeading? { get } -
Sets the delegate for
LocationProvider. The implementation should hold a weak reference to the provided delegate to avoid creating a strong reference cycle withLocationManager.Note
This method should only be called byLocationManager. To allow other objects to participate in location updates, add aLocationConsumerto theLocationManagerinstead.Declaration
Swift
func setDelegate(_ delegate: LocationProviderDelegate) -
Requests permission to use the location services whenever the app is running.
Declaration
Swift
func requestAlwaysAuthorization() -
Requests permission to use the location services while the app is in the foreground.
Declaration
Swift
func requestWhenInUseAuthorization() -
Requests temporary permission for full accuracy
Declaration
Swift
@available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) -
Starts the generation of location updates that reports the device’s current location.
Declaration
Swift
func startUpdatingLocation() -
Stops the generation of location updates.
Declaration
Swift
func stopUpdatingLocation() -
Specifies a physical device orientation.
Declaration
Swift
var headingOrientation: CLDeviceOrientation { get set } -
Starts the generation of heading updates that reports the devices’s current heading.
Declaration
Swift
func startUpdatingHeading() -
Stops the generation of heading updates.
Declaration
Swift
func stopUpdatingHeading() -
Dismisses immediately the heading calibration view from screen.
Declaration
Swift
func dismissHeadingCalibrationDisplay()
LocationProvider Protocol Reference