๐Ÿ”ฐclosure

๐Ÿšง ๆ–ฝๅทฅไธญ

Swift โŸฉ basic types โŸฉ closure

The parameters in closure expression canโ€™t have a default value.

Closures take one of three forms:

  • Global functions๏ผš have a name and donโ€™t capture any values.

  • Nested functions๏ผš have a name and can capture values from their enclosing function.

  • closure expression๏ผš unnamed, can capture values from their surrounding context.

๐Ÿ‘‰ see๏ผšClosures

Last updated