Member-only story
Pass The Swift Code Review: Dictionary Edition
Succinct Swift Code
3 min readMay 26, 2021
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.1, and Swift 5.3
Prerequisites:
- Some knowledge of Swift’s Dictionaries would be useful
- The answers here use the Ternary Operator
- Control Transfer Statements are used in the final solution
- Higher-Order functions are used in the final solution
- Reduce is used in one of the functions
Terminology
Dictionary: The association between keys and values (where all the keys are of the same type, and all values are of the same type)
Let’s go
Writing production-ready code probably requires some quotation marks. I mean, I’ve passed the Linter and managed to push code. Then I get a code review that just consists of a question mark?