это часть кода, который я нашел на StackOverflow.
Он работал в Swift 1.2 Почему этот код больше не работает в Swift 2:
geoCoder.reverseGeocodeLocation(location, completionHandler: { (placemarks, error) -> Void in
let placeArray = placemarks as [CLPlacemark] // !!! ERROR HERE !!!
// Place details
var placeMark: CLPlacemark!
placeMark = placeArray[0]
// Address dictionary
print(placeMark.addressDictionary)
// Location name
if let locationName = placeMark.addressDictionary["Name"] as? NSString {
print(locationName)
}
// Street address
if let street = placeMark.addressDictionary["Thoroughfare"] as? NSString {
print(street)
}
// City
if let city = placeMark.addressDictionary["City"] as? NSString {
print(city)
}
// Zip code
if let zip = placeMark.addressDictionary["ZIP"] as? NSString {
print(zip)
}
// Country
if let country = placeMark.addressDictionary["Country"] as? NSString {
print(country)
}
})
Ошибка GetLocationViewController.swift:67:41: '[CLPlacemark]?' is not convertible to '[CLPlacemark]'