http://stackoverflow.com/questions/30379108/swift-in-keyword-in-a-on-a-function
In a named function, we declare the parameters and return type in the func declaration line.
1 2 3 |
func say(s:String)->() { // body } |
In an anonymous function, there is no func declaration line – it’s anonymous! So we do it with an in line at the start of the body instead.
1 2 3 4 5 |
{ // ( parameters -> return type ) in, <-- the in here let is know that its the interface (s:String)->() in // body } |
(That is the full form of an anonymous function. But then Swift has a series of rules allowing the return type, the parameter types, and even the parameter names and the whole in line to be omitted under certain circumstances.)