In my Storyboard
in Swift
app I have a UIViewController
with MKMapView
stretched to each edge of the screen. It was enough for me to import a MapKit
, then I set up the delegate:
class MyClass: MKMapViewDelegate {
@IBOutlet weak var mapView: MKMapView!
override func viewDidLoad(){
super.viewDidLoad()
mapView.delegate = self
}
}
and then, when I ran the app, I saw the map nicely centered above my country.
I want to implement a feature, that works like this:
when user opens this view, he sees the map, but centered on a place next to my home country, then the map could scroll automatically to center to my home country. Is that even achievable?
For example, if I lived in the US and opened the map, I would see the Pacific Ocean and then the map would scroll to show me the US territory.