我是 Swift 的新手,我有这个扩展:
extension UIView.KeyframeAnimationOptions {
init(animationOptions: UIView.AnimationOptions) {
rawValue = animationOptions.rawValue
}
}
由于 Swift 4.2rawValue = animationOptions.rawValue
产生了这个警告:
Initializer for struct 'UIView.KeyframeAnimationOptions' must use "self.init(...)" or "self = ..." because the struct was imported from C
我使用这样的扩展名:
UIView.animateKeyframes(withDuration: 1.2, delay: 0.0, options: [.repeat, UIView.KeyframeAnimationOptions(animationOptions: .curveEaseOut)], animations: {
...
}
如何从 中修复此警告消息struct was imported from C
?