I use MapKit and I use the code below to change the region:
我使用MapKit,并使用以下代码更改区域:
mapView.setRegion(region, animated: true)
The problem is while changing the region it prevents user interaction with the map.
How can we cancel or stop the "setRegion" when the user engages with the map?
问题是,在更改区域时,它会阻止用户与地图进行交互。当用户使用地图时,我们如何取消或停止“setRegion”?
I expect The map stops changing regions when the user tries to touch it.
我希望当用户尝试触摸地图时,地图会停止更改区域。
更多回答
优秀答案推荐
I didn't use mapkit, but I believe you can stop with the following code:
我没有使用mapkit,但我相信您可以通过以下代码停止:
extension MKMapView {
func stopRegionChangeAnimation() {
self.setRegion(self.region, animated: false)
}
}
更多回答
我是一名优秀的程序员,十分优秀!