When using this func:
func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView! {
let annotationView = AttractionAnnotationView(annotation: annotation, reuseIdentifier: "Attraction")
annotationView.canShowCallout = true
return annotationView
}
This error occured:
Could not cast value of type 'NSKVONotifying_MKUserLocation' (0x7e8a62b0) to 'Park_View.AttractionAnnotation' (0xf7948).
It is working well but when I try to add CoreLocation to find the user location to my code I start having this error.
I found out that MKUserLocation is an annotation too.
Here is the solution that I came out with and it solve the error.