Declare a closure

 Problem

I want to declare and use a simple closure.



 Recipe


// Declare our closure
let myClosure = {
    print("Hello from myClosure!")
}

// Call it
myClosure()
				

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)

 

 Playground