"/>

CLLocationManager delegate not called in ios 10 swift 3 simulator

The CLLocationManager delegate never gets called. Here is my code:

  import UIKit
  import CoreLocation
  class LocationController: UITableViewController, CLLocationManagerDelegate {
  override func viewDidLoad() {
    super.viewDidLoad()
    if (CLLocationManager.locationServicesEnabled())
    {
        locationManager.delegate = self;
        locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
        // ask permission - NOT NECESSARY IF YOU ALREADY ADDED NSLocationAlwaysUsageDescription IT UP INFO.PLIST
        locationManager.requestAlwaysAuthorization()
        // when in use foreground
        locationManager.requestWhenInUseAuthorization()
        locationManager.startUpdatingLocation()
    }
    else{
        print("set up location access  in info.plist")
    }
   }

   private func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    print("locationmanager got called")
    let locValue:CLLocationCoordinate2D = manager.location!.coordinate
    print("locations = (locValue.latitude) (locValue.longitude)")
   }
  }

info.plist settings:

info.plist

My Simulator settings:

simulator setting

Read Full News
Submit your Tech Updates