【发布时间】:2018-04-24 08:13:25
【问题描述】:
来自 Apple 文档pausesoncompletion
因为当此属性为 true 时不会调用完成处理程序,所以您不能使用动画制作者的完成处理程序来确定动画何时完成运行。 相反,您可以通过观察 isRunning 属性来确定动画何时结束。
但我发现观察 isRunning 不起作用。 util我看了WWDC 2017 - Session 230-Advanced Animations with UIKit,我知道我应该观察running
//not work
animator.addObserver(self, forKeyPath: "isRunning", options: [.new], context: nil)
//this work
animator.addObserver(self, forKeyPath: "running", options: [.new], context: nil)
我的问题是:我在哪里可以找到 excatly 密钥路径,不仅是这种情况。谢谢~
【问题讨论】:
标签: ios animation key-value-observing uiviewpropertyanimator