Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 直到动画结束,注释才可单击_Ios_Swift_Annotations_Swift3_Mapkit - Fatal编程技术网

Ios 直到动画结束,注释才可单击

Ios 直到动画结束,注释才可单击,ios,swift,annotations,swift3,mapkit,Ios,Swift,Annotations,Swift3,Mapkit,众所周知,要移动地图标记,我们必须使用此代码 UIView.animate(withDuration: 10, animations: { self.marker.coordinate = newCoordinate }) 但在这种情况下,在所有的10秒钟内,我的注释是不可点击的! 它们只在11秒时才可点击 我知道我可以像在谷歌地图中一样使用计时器和自己计算坐标,但也许你们知道更好的解决方案?更改为:选项:UIViewAnimationOptions.AllowUserInterac

众所周知,要移动地图标记,我们必须使用此代码

UIView.animate(withDuration: 10, animations: {
     self.marker.coordinate = newCoordinate
})
但在这种情况下,在所有的10秒钟内,我的注释是不可点击的! 它们只在11秒时才可点击


我知道我可以像在谷歌地图中一样使用计时器和自己计算坐标,但也许你们知道更好的解决方案?

更改为:选项:UIViewAnimationOptions.AllowUserInteraction

UIView.animate(withDuration: TimeInterval(timeLeft), delay: 0, options: UIViewAnimationOptions.AllowUserInteraction, animations:  {
格式化上面的代码,你就知道了


更改为:选项:UIViewAnimationOptions.AllowUserInteraction

UIView.animate(withDuration: TimeInterval(timeLeft), delay: 0, options: UIViewAnimationOptions.AllowUserInteraction, animations:  {
格式化上面的代码,你就知道了

看一看