Cannot tap on Annotation View
happiehappie opened this issue · 0 comments
happiehappie commented
Below is my code
`if let annotation = annotation as? CCHMapClusterAnnotation {
let identifier = "clusterAnnotation"
var clusterAnnotationView: ClusterAnnotationView? = mapView.dequeueReusableAnnotationView(withIdentifier: identifier) as! ClusterAnnotationView?
if let clusterAnnotationView = clusterAnnotationView {
clusterAnnotationView.annotation = annotation
} else {
clusterAnnotationView = ClusterAnnotationView(annotation: annotation, reuseIdentifier: identifier)
clusterAnnotationView!.canShowCallout = true
}
let clusterAnnotation: CCHMapClusterAnnotation = annotation
clusterAnnotationView!.count = clusterAnnotation.annotations.count
annotationView = clusterAnnotationView!
}`
however
`func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
print("yayayayy")
mapView.deselectAnnotation(view.annotation, animated: false)
}`
never gets printed as long as I have annotationView = clusterAnnotationView! in my view for annotation.
I can tap on my annotation fine if I remove that line (of course that is a bad idea cause I need my custom info)