在动画结束之前,注释不可单击

时间:2017-01-30 14:38:39

标签: ios swift annotations swift3 mapkit

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

UIView.animate(withDuration: 10, animations: {
     self.marker.coordinate = newCoordinate
})

但在这种情况下,在所有10秒内我的注释都无法点击! 它们只在11秒内变得可点击。

我知道我可以使用Timer并自己计算坐标,就像谷歌地图一样,但也许你知道更好的解决方案吗?

1 个答案:

答案 0 :(得分:2)

更改为:options:UIViewAnimationOptions.AllowUserInteraction

    id R1.11 R1.12 R1.13 R1.14 R1.15
id    1     0     0     0     0     0
id1   2     0     0     0     0     0
id2   3     0     0     0     0     0
id3   4     0     0     0     0     0
id4   5     0     0     0     0     0
id5   6     0     0     0     1     0
id6   7     0     0     0     0     0
id7   8     0     0     0     0     0
id8   9     0     0     0     0     0
id9  10     0     0     0     0     0
id10 11     0     0     0     0     0
id11 12     0     0     0     0     0
id12 13     0     0     0     0     0
id13 14     0     0     0     0     0
id14 15     0     0     0     0     0
id15 16     0     0     0     0     0

格式化上面的代码,你明白了。

Taken from here where I answered similar question: