Loading new pins on MKMapView as user scrolls and zooms using AFNeworking

51 Views Asked by At

Initially I load 10 pins using AFNetworking and plot them on the map and set the map zoom level to fit these 10 pins, however in my database I have 1000 pins and I want to load them as the user scrolls or zooms, how would I go about doing this?

1

There are 1 best solutions below

0
Kosuke Ogawa On

I develop similar app. In my case, I load new pins in regionDidChangeAnimated method.

func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) {
    // load new pins 
}

As you know, this method is called by the user scrolls or zooms.