I have the following line which used to work in iOS 8 in Swift.
let placemark = placemarks![0] as? CLPlacemark
let destinationPlacemark = MKPlacemark(
coordinate: placemark!.location!.coordinate,
addressDictionary: placemark?.addressDictionary
)
but now it gives me the following exception:
Cannot convert value of type '[NSObject : AnyObject]?' to expected argument type '[String : AnyObject]?'
How can I do that?
You need to cast the type to [String : AnyObject]
placemark?.addressDictionary as? [String:AnyObject]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With