Zeige den aktuellen Standort und aktualisiere den Standort in MKMapView in Swift

Bin ich lernen, wie man die neue Swift-Sprache (nur Swift, keine Objective-C). Es zu tun, möchte ich eine einfache Ansicht mit einer Karte (MKMapView). Ich möchte zu finden und aktualisieren den Standort der user (wie in der Apple-Map-app).

Ich habe versucht, aber nichts passiert:

import MapKit
import CoreLocation

class MapView : UIViewController, CLLocationManagerDelegate {

    @IBOutlet weak var map: MKMapView!
    var locationManager: CLLocationManager!

    override func viewDidLoad() {
        super.viewDidLoad()

        if (CLLocationManager.locationServicesEnabled())
        {
            locationManager = CLLocationManager()
            locationManager.delegate = self
            locationManager.desiredAccuracy = kCLLocationAccuracyBest
            locationManager.requestAlwaysAuthorization()
            locationManager.startUpdatingLocation()
        }
    }
}

Könnten Sie mir bitte helfen?

InformationsquelleAutor der Frage PMIW | 2014-08-22

Schreibe einen Kommentar