The location point on the map in the simulator is not loaded, just the map is visible, although everything seems to be fully spelled out. Let it be for now:
It should be like this:
Here is the file code. It seems that everything that was needed was spelled out:
import UIKit import MapKit import CoreLocation class MapVC: UIViewController { @IBOutlet weak var mapView: MKMapView! var locationManager = CLLocationManager() let authorizationStatus = CLLocationManager.authorizationStatus() let regionRadius: Double = 1000 override func viewDidLoad() { super.viewDidLoad() mapView.delegate = self locationManager.delegate = self configureLocationServices() } @IBAction func centerMapBtnWasPressed(_ sender: Any) { if authorizationStatus == .authorizedAlways || authorizationStatus == .authorizedWhenInUse{ centerMapOnUserLocation() } } } extension MapVC: MKMapViewDelegate { func centerMapOnUserLocation() { guard let coordinate = locationManager.location?.coordinate else { return } let coordinateRegion = MKCoordinateRegionMakeWithDistance(coordinate, regionRadius * 2.0, regionRadius * 2.0) mapView.setRegion(coordinateRegion, animated: true) } } extension MapVC: CLLocationManagerDelegate { func configureLocationServices(){ if authorizationStatus == .notDetermined{ locationManager.requestAlwaysAuthorization() } else { return } } func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { centerMapOnUserLocation() } } Here is an image (to enlarge, just click on it) of the plist file changed during the work. Added last three lines. The latter is different from the one that was in the video tutorial. Wednesday insistently suggested to register as in the end it was prescribed - "Privacy - Location", in the video tutorial, the last line had a slightly different appearance, namely, "NSLocationAlwaysAndWhenInUseUsageDescription". I do not know whether this has any meaning, I cite it, just in case:




