无法更改 watchOS 2 中动画动态图像的持续时间

cannot change duration of animated dynamic images in watchOS 2

更新:我做了一个 XCode 7.3 sample project displaying the problem

问题:

我正在通过 session:didReceiveMessage:replyHandler:NSData 图像帧从 iPhone (Obj-C) 传输到手表 (Swift)。这些帧最初是由手表通过 session.sendMessage(myMessage, replyHandler:) 请求的。我正在使用 UIImage(data: frame) 将这些图像转换回 PNG 并附加到名为 images 的数组。我有一个名为 animationImageWKInterfaceImage,我可以在其中加载帧并像这样显示它们:

let frames = UIImage.animatedImageWithImages(images, duration: myDuration)
animationImage.setImage(frames)
animationImage.startAnimating()

问题是,无论 myDuration 中的值是多少,我总是获得相同的速度(即:超快):

这些动画在 phone:

中正常显示

我做错了什么?

XCode 版本 7.3 (7D175) iOS 9.0(部署目标)

编辑:

这就是 the docs 关于 watchOS 动画的说法 WKInterfaceImage:

For animations you generate dynamically, use the animatedImageWithImages:duration: method of UIImage to assemble your animation in your WatchKit extension, and then set that animation using the setImage: method.

像imageView一样设置动画持续时间,

 animationImage.animationDuration = myDuration

希望这会有所帮助:)

我无法解释为什么 WKInterfaceImage 的 startAnimating() 没有利用动画图像的持续时间,但在使用这个时它似乎确实可以适当地动画:

animationImage.startAnimatingWithImagesInRange(NSMakeRange(0, images.count), duration: myDuration, repeatCount: 0)