这样可以正常工作,但是当我不断按下缩小按钮时,它会在某种程度上给我异常。我该如何预防?
//MARK: MKMapView
extension MKMapView {
// delta is the zoom factor
// 2 will zoom out x2
// .5 will zoom in by x2
func setZoomByDelta(delta: Double, animated: Bool) {
var _region = region
var _span = region.span
_span.latitudeDelta *= delta
_span.longitudeDelta *= delta
_region.span = _span
setRegion(_region, animated: animated)
}
}