'animate(withDuration:delay:options:animations:)' 的使用不明确
Ambiguous use of 'animate(withDuration:delay:options:animations:)'
我已经升级到新发布的Xcode 8,而这个
let mediumInterval: TimeInterval = 0.6
UIView.animate(withDuration: mediumInterval) {
print("test")
}
给我错误 Ambiguous use of 'animate(withDuration:delay:options:animations:)'
我真的不明白这里有什么歧义... UIView
中声明的所有 animate
函数都是
open class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions = [], animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
open class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
open class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Swift.Void)
open class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIViewAnimationOptions = [], animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
===获取xcode编译的解决方案===
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
}, completion: nil)
会编译,
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
})
会像以前一样失败。我还是不明白发生了什么...
我一直在使用的 PromiseKit 似乎有一个 UIView 的扩展,它定义了一个冲突版本的 animate (https://github.com/PromiseKit/UIKit/blob/master/Sources/UIView%2BPromise.swift)
XCode 无法告诉我这两个相互冲突的版本来自哪里,所以我花了一段时间才明白。我已经报告了这个问题。
我有同样的错误,因为我忘记在 "animation" 中添加 "s"。
所以也许 :
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
})
因此无法编译。
我已经升级到新发布的Xcode 8,而这个
let mediumInterval: TimeInterval = 0.6
UIView.animate(withDuration: mediumInterval) {
print("test")
}
给我错误 Ambiguous use of 'animate(withDuration:delay:options:animations:)'
我真的不明白这里有什么歧义... UIView
中声明的所有 animate
函数都是
open class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions = [], animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
open class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
open class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Swift.Void)
open class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIViewAnimationOptions = [], animations: @escaping () -> Swift.Void, completion: (@escaping (Bool) -> Swift.Void)? = nil)
===获取xcode编译的解决方案===
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
}, completion: nil)
会编译,
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
})
会像以前一样失败。我还是不明白发生了什么...
我一直在使用的 PromiseKit 似乎有一个 UIView 的扩展,它定义了一个冲突版本的 animate (https://github.com/PromiseKit/UIKit/blob/master/Sources/UIView%2BPromise.swift)
XCode 无法告诉我这两个相互冲突的版本来自哪里,所以我花了一段时间才明白。我已经报告了这个问题。
我有同样的错误,因为我忘记在 "animation" 中添加 "s"。 所以也许 :
UIView.animate(withDuration: mediumInterval, animation: {
print("test")
})
因此无法编译。