Skip to content

Instantly share code, notes, and snippets.

@pofat
Created December 11, 2018 14:40
Show Gist options
  • Save pofat/441fc74a047a95bc3bf30ba12513f4d0 to your computer and use it in GitHub Desktop.
Save pofat/441fc74a047a95bc3bf30ba12513f4d0 to your computer and use it in GitHub Desktop.
How to detect the first drag after map is loaded
class MapViewController: UIViewController {
var isLoaded = false
}
extension MapViewController: MKMapViewDelegate {
func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) {
if isLoaded {
mapDidDrag()
}
}
func mapViewDidFinishLoadingMap(_ mapView: MKMapView) {
isLoaded = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment