Create an empty array

 Problem

I want to create/initialize an empty Array.



 Recipe


// Initialize the Array - Solution A
let a1 = [Int]()

// Initialize the Array - Solution B
let a2 : [Int] = []
				

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