Chapter 8: Collection Iterations With Closures
大綱
Closure basics
var multiplyClosure = { (a: Int, b: Int) -> Int in
return a * b
}
let result = multiplyClosure(4, 2)Shorthand syntax
Closures with no return value
Capturing from the enclosing scope
Custom sorting with closures
Iterating over collections with closures
Key points
Last updated