如何在 swift 中声明一个作为闭包的局部变量

How to declare a local variable that is a closure in swift

我想声明一个闭包类型的局部变量,我该怎么做?

var myClosure: (myParamaterTypes) -> myReturnTypes

例如:

var myClosure: (Int, Int) -> Int  // type is (Int, Int) -> Int
myClosure = {(integer01: Int, integer02: Int) -> Int in return integer01 + integer02}