I implement the map function in my application, where I allow the user to set their current location by panning.
All this time I want to have MKAnnotation in centerCoordinate . Therefore, I want to keep track of when the center of the Coordinate map changes and correctly changes the coordinate of the annotation. The behavior would be similar to the behavior of Uber, Hailo and others.
I tried a time-based implementation where all 0.00001s centerCoordinate will be checked, and the annotation will also be moved. But if the card does not move accurately, the annotation jumps from one place to another, which does not create a good user interface.
Another implementation that I tried is gesture recognizers and MKMapView delegate MKMapView ( regionDidChange / regionWillChange ). This, again, leads to a very sharp transition.
Can anyone advise me how to do this better?
source share