Using Swifts KeyPaths in Higher-Order Functions
How KeyPaths improve map, compactMap, flatMap, and filter
Published in
6 min readFeb 2, 2020
When working with collections like arrays or sets, we can use so-called higher-order functions like map
to transform each element of the collection or filter
to get a subset of the collection’s elements.