how to fix this error :
"downcast from CLplacemark? to Clplacemark only unwraps optional"
so i use this code :
if let p = CLPlacemark(placemark: placemarks.first as? CLPlacemark){}
and change placemarks[0] array but not work
and my code is :
CLGeocoder().reverseGeocodeLocation(userLocation) { (placemarks, error) -> Void in
if error == nil {
if let p = CLPlacemark(placemark: placemarks[0] as? CLPlacemark){
print(p)
self.adsresslabel.text = "\(p.administrativeArea)\(p.postalCode)\(p.country)"
}
}else {
print (error)
}
}
at this code :
if let p = CLPlacemark(placemark: placemarks[0] as? CLPlacemark)
i have error about
"downcast from CLplacemark? to Clplacemark only unwraps optional"
how to fix this error ?!