December 2018
Intermediate to advanced
414 pages
10h 19m
English
Dictionaries are value types, and they follow the same mutability and initialization as other value types.
Let's use some important dates—the release dates for Swift—to work with dictionaries:
let swiftReleases = [ "2014-09-09": "Swift 1.0", "2014-10-22": "Swift 1.1", "2015-04-08": "Swift 1.2", "2015-09-21": "Swift 2.0", "2016-09-13": "Swift 3.0", "2017-09-19": "Swift 4.0", "2018-03-29": "Swift 4.1", "2018-09-17": "Swift 4.2"] // Swift release dates, source Wikipedia
As you can see, the dictionary type is quite simple; it's Dictionary<String, String>, which we can also denote as [String: String].
Similar to the Array and other value types, using the let keyword makes the dictionary immutable, which means the ...
Read now
Unlock full access