当我使用这个方法时,我的项目将无法编译,但每当我删除它时我都没有错误,我很困惑为什么会发生这种情况。这就是我正在使用的
func animateNode(object: AnyObject){
AnyObject.animate(withDuration: 1.0, animations: {
var objFrame = object.frame
objFrame.origin.y -= objFrame.size.height
object.frame = objFrame
},completion: { finished in
print("Animation Complete")
})
}
答案 0 :(得分:0)
Swift 3
看看括号。
AnyObject.animate(withDuration: 1.0, animations: {
// Code ...
}) { finished in
// Code ...
print("Animation Complete")
}
我希望这可以帮到你。