The underestimated power of KeyPaths
summary
Claims that Swift KeyPaths let code drop verbose closures and become declarative, backed by concrete helpers: implemented generic map/sorted wrappers and a prefix caret operator to convert KeyPath into getters, plus a predicate DSL that compiles to type‑safe NSPredicate‑like filters. Also builds patterns: a builder/identifiable/validator patterns trio that uses KeyPaths for equality, configuration and validation. Examples include sequence extensions, operator overloads and a GitHub repo; runtime behavior works and reported compile/runtime cost is negligible in common cases.
AI-written summary · about
chapters (17)
- 0:00Start
- 3:02How to implement it?
- 5:30From KeyPath to getter function
- 6:42Defining an operator
- 7:40Just build another helper
- 12:01Defining Predicates
- 12:29Constructing Predicates
- 14:04Combining Predicates
- 14:44Evaluating Predicates
- 15:14That's all you need!
- 15:56Switching with Predicates
- 17:13Builder Pattern
- 20:03Identifiable Pattern
- 22:22Validable Pattern
- 26:03Recap
- 27:44Conclusion
- 28:59IOS Conf SG January 2019








