Closure in Swift: A reminder on how awesome they are.

I was re-reading Apple’s documentation about closure and I tough it couldn’t hurt anybody to share this little resume about closure syntax.

Here’s a simple closure :

Here’s the same but simpler :

Hmm even simpler :

Huh ?!? Even more :

WTF ?!?! Really ?! (but yeah it works) :

And finally (unreadable but still) :

From The Swift Programming Language (Swift 3.0.1)



Leave a Reply

Your email address will not be published. Required fields are marked *