Map annotation Visibility


MKMapRectContainsPoint will tell you if it is visible.
visibleCount = 0;
for (MyAnnotation *annotation in mapView.annotations) {
    if (MKMapRectContainsPoint(mapView.visibleMapRect, MKMapPointForCoordinate(annotation.coordinate)))
    {
        visibleCount++;
    }
}

Comments

Popular posts from this blog

iOS Architecture

Property vs Instance Variable (iVar) in Objective-c [Small Concept but Great Understanding..]

setNeedsLayout vs layoutIfNeeded Explained