当我使用这种方法时,我的项目将无法编译,但每当我删除它时,我都不会收到错误,我很困惑为什么会发生这种情况。这就是我正在使用的
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")
})
}
最佳答案
swift 3
看一下括号。
AnyObject.animate(withDuration: 1.0, animations: {
// Code ...
}) { finished in
// Code ...
print("Animation Complete")
}
希望这可以帮助你。
关于swift - 为什么这个函数给我一个 "Command Failed due to signal"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44206195/