I\'m trying to zoom a map into the user\'s current location once the view loads, but I\'m getting the error \"** * Terminating app due to uncaught exception \'NSInvalidA
Here is @Deepak's answer in Swift 3 for iOS 10:
extension ViewController: MKMapViewDelegate
{
func mapView( _ mapView: MKMapView, didUpdate userLocation: MKUserLocation )
{
let regionRadius = 400 // in meters
let coordinateRegion = MKCoordinateRegionMakeWithDistance( userLocation.coordinate, regionRadius, regionRadius )
self.mapView.setRegion( coordinateRegion, animated: true)
}
}