How can I convert MKMapItem to CLPlacemark in Swift?
My code gives me a compiler error 'MKMapItem' is not convertible to 'CLPlacemark':
var mapItems:[MKMapItem] = []
let mi = self.mapItems[indexPath.row];
ann.placemark = mi as CLPlacemark
In ObjC I just did ann.placemark = (CLPlacemark *)mi;
MKMapItemis not a subclass ofCLPlacemark. I'm not that familiar with MapKit, so maybe it was indeed possible to directly cast aMKMapItemto aCLPlacemarkwithout problem.MKMapItemdoes have a property calledplacemarkwith typeMKPlacemarkthough.MKPlacemarkis a subclass ofCLPlacemarkand can be used as such.