Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func action(_ gestureRecognizer:UIGestureRecognizer) { // GESTURE RECOGNIZER FUNCTION
- if gestureRecognizer.state == UIGestureRecognizerState.began {
- let touchPoint = gestureRecognizer.location(in: self.map)
- let newCoordinate = self.map.convert(touchPoint, toCoordinateFrom: self.map)
- let location = CLLocation(latitude: newCoordinate.latitude, longitude: newCoordinate.longitude)
- CLGeocoder().reverseGeocodeLocation(location, completionHandler: { (placemarks, error) -> Void in
- var title = ""
- if (error == nil) {
- if let p = placemarks?[0] {
- var subThoroughfare:String = ""
- var thoroughfare:String = ""
- if p.subThoroughfare != nil {
- subThoroughfare = p.subThoroughfare!
- }
- if p.thoroughfare != nil {
- thoroughfare = p.thoroughfare!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement