Guest User

Untitled

a guest
Jul 15th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // Tap to set location
  2. @IBAction func mapPoint(_ sender: UITapGestureRecognizer) {
  3.  
  4. // Retrieve coordinates
  5. let location = sender.location(in: self.mapView)
  6. let locCoord = self.mapView.convert(location, toCoordinateFrom: self.mapView)
  7.  
  8. // Create pin
  9. let annotation = MKPointAnnotation()
  10. annotation.coordinate = locCoord
  11. annotation.title = "Meeting Point"
  12.  
  13. self.mapView.addAnnotation(annotation)
  14.  
  15. }
Add Comment
Please, Sign In to add comment