Location information using CoreLocation

Hi, I am creating an application with SwiftUI using CoreLocation. When I set the positioning system to kCLLocationAccuracyBest, the system does not appear. When I view it in GoogleMap, it sometimes shows me as if I am in a house instead of a street.

Please let me know how I can improve the system.

class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate{
  var locationManager : CLLocationManager?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool{
    locationManager = CLLocationManager()
    locationManager!.delegate = self
    locationManager!.requestAlwaysAuthorization()

    if CLLocationManager.locationServicesEnabled(){
      locationManager!.desiredAccuracy = kCLLocationAccuracyBest
      locationManager!.distanceFilter = 10
      locationManager!.allowsBackgroundLocationUpdates = true
      locationManager!.pausesLocationUpdatesAutomatically = false
      locationManager!.startUpdatingLocation()
    }
    return true
  }

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]){
    guard let newLocation = locations.last else {
      return
    }

    let location: CLLocationCoordinate2D = CLLocationCoordinate2DMake(newLocation.coordinate.latitude, newLocation.coordinate.longitude)

The system does not appear.

Which system are you speaking about ?

When I view it in GoogleMap, it sometimes shows me as if I am in a house instead of a street.

When you view what ? The location ?

The result of the location information is that you should be on the road, but you are in a house along the road a little to the side.

Location information using CoreLocation
 
 
Q