write in the "override fun viewDidLoad(){
let AAA = MKPointAnnotation()
let centerCoordinate = CLLocationCoordinate2D(latitude: 10.79661075, longitude: 106.69064892)
AAA.coordinate = centerCoordinate
AAA.title = "test"
AAA.subtitle = "abced"
self.theMap.addAnnotation(AAA)
"addAnnotation" helps you to drop the pin on the map.
*don't forget to declare the Map = MKMapView with import MapKit.
No comments:
Post a Comment