Skip to content

Instantly share code, notes, and snippets.

@susanna2222
Last active August 21, 2019 05:48
Show Gist options
  • Save susanna2222/98609decc7d84455c71c8a1ba8a576a8 to your computer and use it in GitHub Desktop.
Save susanna2222/98609decc7d84455c71c8a1ba8a576a8 to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
// setup Map View on User Location
let noLocation = CLLocationCoordinate2D()
let span = MKCoordinateSpan(latitudeDelta: 0.001, longitudeDelta: 0.001)
let viewRegion = MKCoordinateRegion(center: noLocation, span: span)
mapView.delegate = self
mapView.region = viewRegion
mapView.showsUserLocation = true
mapView.userTrackingMode = .follow
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment