BBB*_*BBB -3 swift swift-playground
Swift提供了以下代码.如何在没有括号的情况下调用squishEm函数?是不是函数和属性之间的语法差异?
func squishEm() {
// Iterate over graphics and squish each one.
for graphic in graphics {
squishGraphic(graphic: graphic)
}
}
// Create and add Squish ’Em! button.
let squishButton = Button(name: "Squish ’Em!")
squishButton.onTap = squishEm
scene.button = squishButton
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
541 次 |
| 最近记录: |