Cluster Annotations | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/14255236-swiftui-maps-location-fundamentals/lessons/8

I noticed a minor type related to a stringified reuse identifier in the placeAnnotation annotation view “creation”.

let annotationView =  mapView.dequeueReusableAnnotationView(
  withIdentifier: "InterestingPlace") as? MKMarkerAnnotationView 
  ?? MKMarkerAnnotationView(
       annotation: annotation, reuseIdentifier: "Interesting Place")

Notice the space character in one but not the other:

withIdentifier: "InterestingPlace"
vs.
reuseIdentifier: "Interesting Place"

for the example used it doesn’t seem to be causing an issue, but the ID employed for reuse should match the one used in creation, correct?