0

I'm trying to have a user click an annotation and in the next view some information such as an address is represented in a UITextField. However when trying to get annotation.subtitle I get an error regarding the return value of MKAnnotation.subtitle to be String?? instead of what I want, String. Should I be using reverseGeocodeLocation ?

  • yes, MapKit provide this : https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLGeocoder_class/#//apple_ref/occ/instm/CLGeocoder/reverseGeocodeLocation:completionHandler: – sonique May 18 '16 at 02:07
  • Possible duplicate of [Swift - CLGeocoder reverseGeocodeLocation completionHandler closure](http://stackoverflow.com/questions/24345296/swift-clgeocoder-reversegeocodelocation-completionhandler-closure) – sonique May 18 '16 at 02:30

1 Answers1

0

Yes, use it you will get a CLPlacemark Object, that contain, name, address...

Reference: https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLPlacemark_class/index.html#//apple_ref/swift/cl/c:objc(cs)CLPlacemark

sonique
  • 4,539
  • 2
  • 30
  • 39
  • do you have example code for what it looks like, I'm having trouble getting reverseGeocoding working. Especially because it's in a function –  May 18 '16 at 02:12
  • http://stackoverflow.com/questions/24345296/swift-clgeocoder-reversegeocodelocation-completionhandler-closure – sonique May 18 '16 at 02:30