I was asked whether Objective C blocks are more similar to closures or callbacks. However, the definition of a callback seems nearly identical to a closure, at least in this example borrowed from http://swiftspace.org/callback-function-in-swift/:
func mainFunction(callback: () -> Void) {
// some code
callback() // call the callback function
}
In the Programming Language Guide (Swift 2.2) callbacks are rarely mentioned, with this one notable exception where a callback sounds like a type of closure:
“When a closure’s type is already known, such as the callback for a delegate, you can omit the type of its parameters, its return type, or both.”
Help?