每当用户移动我的MKMapView时,我会在地图上加载更多针脚。现在,我正在使用此代码来检测它们何时拖动它:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
- (void)didDragMap:(UIGestureRecognizer*)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateEnded){
CLLocationCoordinate2D topLeft, bottomRight;
topLeft = [self.mapView convertPoint:CGPointMake(0, 0) toCoordinateFromView:self.mapView];
CGPoint pointBottomRight = CGPointMake(self.mapView.frame.size.width, self.mapView.frame.size.height);
bottomRight = [self.mapView convertPoint:pointBottomRight toCoordinateFromView:self.mapView];
[self loadMorePlaces:topLeft bottomRight:bottomRight];
}
}
但是,这仅检测用户何时停止拖动。用户可以“甩掉”地图,地图在完成“拖动”之后仍然可以移动。当地图停止移动时,我能找到一种方法吗?感谢