Trying to get formatted address from AddressDictionary, that I got from CLGeocoder. Used following code with no result:
subtitle = [NSString stringWithString
I am using Swift 3 / XCode 8
ZYiOS's answer was nice and short but did not compile for me.
The question asks how to get from an existing Address Dictionary to a string address. This is what I did:
import CoreLocation
func getAddressString(placemark: CLPlacemark) -> String? {
var originAddress : String?
if let addrList = placemark.addressDictionary?["FormattedAddressLines"] as? [String]
{
originAddress = addrList.joined(separator: ", ")
}
return originAddress
}