Skip to content

Commit a1bcfaf

Browse files
committed
added that dictionary enumeration tuples have labels
1 parent e46ecef commit a1bcfaf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bk1ch04p218dictionaries/bk1ch04p218dictionaries/ViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ class ViewController: UIViewController {
5959
for (abbrev, state) in d {
6060
print("\(abbrev) stands for \(state)")
6161
}
62+
63+
for pair in d {
64+
print("\(pair.key) stands for \(pair.value)")
65+
}
6266

6367
let arr = Array(d) // [("NY", "New York"), ("CA", "California")]
6468
print(arr)

0 commit comments

Comments
 (0)