这是吗
UIView.animateWithDuration(1, animations: {
newView.transform = afterAnimationTransform
})
还有这个
UIView.animateWithDuration(1){
newView.transform = afterAnimationTransform
}
等效?如果是,这个功能叫什么?它只对最后一个参数有效吗?
最佳答案
它被称为尾随闭包,是的,这些表达式是等价的,第二个是简写。阅读 Swift 2.1 编程语言。
关于ios - 这在 Swift 中怎么可能呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34979115/