DefaultLocationProvider

public class DefaultLocationProvider
extension DefaultLocationProvider: LocationProvider

Returns user location in energy efficient approach.

Would not trigger Location Permission dialogs but will retrieve permission changes notification. Suitable for SearchEngine for providing user location by default without additional efforts.

  • DefaultLocationProvider constructor with CLLocationManager

    Declaration

    Swift

    public init(locationManager: CLLocationManager)

    Parameters

    locationManager

    CLLocationManager to use

  • Convenience DefaultLocationProvider constructor without CLLocationManager

    Declaration

    Swift

    public convenience init(
        distanceFilter: CLLocationDistance = 100,
        desiredAccuracy: CLLocationAccuracy = kCLLocationAccuracyHundredMeters,
        activityType: CLActivityType = .other
    )

    Parameters

    distanceFilter

    The minimum distance (measured in meters) a device must move horizontally before an update event is generated.

    desiredAccuracy

    The accuracy of the location data.

    activityType

    The type of user activity associated with the location updates.

  • Device location for LocationProvider

    Declaration

    Swift

    public func currentLocation() -> CLLocationCoordinate2D?

    Return Value

    actual location