MTLocationManager

public class MTLocationManager : NSObject, @preconcurrency CLLocationManagerDelegate

Class responsible for location updates.

  • Initializes the location manager.

    Declaration

    Swift

    public init(using manager: CLLocationManager? = nil, accuracy: CLLocationAccuracy? = nil)
  • Starts the location updates.

    Updates are available in didUpdateLocations method.

    Declaration

    Swift

    public func startLocationUpdates()
  • Requests location only once and calls didUpdateLocations delegate method.

    Declaration

    Swift

    public func requestLocationOnce()
  • Stops the location updates.

    Declaration

    Swift

    public func stopLocationUpdates()
  • Requests whenInUse location permission.

    Declaration

    Swift

    @MainActor
    public func requestLocationPermission()
  • Requests always location permission.

    Make sure whenInUse location permission is active first.

    Declaration

    Swift

    @MainActor
    public func requestAlwaysLocationPermission()
  • Undocumented

    Declaration

    Swift

    @MainActor
    public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
  • Undocumented

    Declaration

    Swift

    @MainActor
    public func locationManager(_ manager: CLLocationManager, didFailWithError error: Error)