Fixed #129
This commit is contained in:
@ -390,7 +390,7 @@ Swift 统一的函数语法足够灵活,可以用来表示任何函数,包
|
|||||||
|
|
||||||
### 使用函数类型(Using Function Types)
|
### 使用函数类型(Using Function Types)
|
||||||
|
|
||||||
在Swift中,使用函数类型就像使用其他类型一样。例如,你可以定义一个常量或变量,它的类型是函数,并且可以幅值为一个函数:
|
在Swift中,使用函数类型就像使用其他类型一样。例如,你可以定义一个类型为函数的常量或变量,并将函数赋值给它:
|
||||||
|
|
||||||
var mathFunction: (Int, Int) -> Int = addTwoInts
|
var mathFunction: (Int, Int) -> Int = addTwoInts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user