March 2017
Intermediate to advanced
226 pages
5h 13m
English
When expressing extensive collections in code, using multiline layout offers advantages:
Individual lines are easier to comment—and to comment out if needed.
Distinct lines provide better diffs when comparing committed revisions.
| | /// Mens colors provide a restricted set of name categories |
| | /// Magenta and Cyan are renamed to more common names |
| | /// and a secondary color walk fills in other colors |
| | public let mensColorNames: [String: Color] = [ |
| | // Primary color walk |
| | "Red": .red, |
| | "Orange": .orange, |
| | "Yellow": .yellow, |
| | "Green": .green, |
| | "Blue": .blue, |
| | "Purple": .purple, |
| | "Blue-Green": .cyan, |
| | "Red-Purple": .magenta, |
| | |
| | // Secondary "missing" colors |
| | "Green-Blue": ... |
Read now
Unlock full access