在我的WatchKit项目中,我有一个图像,当startAnimatingWithImagesInRange启动的动画完成时,我想执行一个方法。正如Xcode提示的那样,在animationDidStop中存在一个WKInterfaceImage方法。

不过,我在WKInterfaceImage参考中找不到它,这让我很失望。那么,它是一个bug还是它不是,我如何使用这个方法?或者我应该使用NSTimer来解决一些问题
发布于 2015-04-25 22:31:57
新答案
我想你在Xcode中发现了一个bug。正如您注意到的,文档没有显示WKInterfaceImage符合CAAnimation或其委托。下面是我在操场上做的一个小测试,以确认这是一个问题:
// Documented Methods
WKInterfaceImage.instancesRespondToSelector(Selector("startAnimating")) // returns true
WKInterfaceImage.instancesRespondToSelector(Selector("stopAnimating")) // returns true
// Undoscumented Methods
WKInterfaceImage.instancesRespondToSelector(Selector("animationDidStart:")) // returns false
WKInterfaceImage.instancesRespondToSelector(Selector("animationDidStop:")) // returns false因此,即使它自动完成,我也不认为这些方法会被击中,因为WatchKit没有附带CAAnimation支持,也没有提供替代CAAnimation。
旧答案
在stopAnimation上有一个WKInterfaceImage方法
https://stackoverflow.com/questions/29871429
复制相似问题