Create an empty dictionary

 Problem

I want to create/initialize an empty Dictionary.



 Recipe


// Initialize the Dictionary - Solution A
let d1 = [String:String]()

// Initialize the Dictionary - Solution B
let d2 : [String:String] = [:]
				

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