After completing a loop that places annotations on a map from an array, I want to count the number of annotations.
My code as follows:
let anCount = self.mapView.annotations?.count
if (anCount > 1) {
//do something
}
gives error:
Value of optional type 'Int?' must be unwrapped to a value of type 'Int'
The fixit suggestions yield other errors. What is the correct way to count the number of annotations for the map.
Thanks for any suggestions.