ClusterKit
ClusterKit copied to clipboard
mapView(_:didTap:) crashes randomly
Hi I am getting this crash randomly on Production live app.
Here is the code snippet: func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
if marker.responds(to: #selector(getter: GMSMarker.cluster)) {
if let cluster = marker.cluster, cluster.count > 1 { **// crash strack trace indicating this line where crash happen**
OperationQueue.main.addOperation {
let cameraUpdate = GMSCameraUpdate.fit(marker.cluster!)
mapView.animate(with: cameraUpdate)
}
return true
}
}
}
ClusterKit version: 0.5.0 GoogleMapExtension: "GMSMapView+ClusterKit.h"

This is Firebase crash report :

Please help me out. It would be highly appreciated as I'm getting this crash from last 4 - 5 releases.
when you remove marks from map - remove them from the map as well (not only from cluster manager) the cluster manager is not synced with what you see on the map other wise.