How to get Current Location using SwiftUI, without ViewControllers?
问题 I've prepared in my project the following class to retrieve the user current location: LocationManager.swift import Foundation import CoreLocation class LocationManager: NSObject { // - Private private let locationManager = CLLocationManager() // - API public var exposedLocation: CLLocation? { return self.locationManager.location } override init() { super.init() self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest self.locationManager