I have a map that helps a friends find each other. The number of friends are too high and scattered around the map. I want to only load the friends from my api that pertain to the current view the user sees. If the user swipes, different set of users are displayed. Looking at the MKMapViewDelegate events, the only place suitable for what I want to do is:
optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool)
but according to documentation, I shouldn't be adding complex code to it:
Discussion This method is called whenever the currently displayed map region changes. During scrolling, this method may be called many times to report updates to the map position. Therefore, your implementation of this method should be as lightweight as possible to avoid affecting scrolling performance.
I've looked at the other events, no other events will give me what I want. Which other MKMapViewDelgate event do you think I should utilize!?