KeyPath values
In Swift, what exactly does a KeyPath like \.name represent as a value?
In Swift, what exactly does a KeyPath like \.name represent as a value?
A KeyPath is a value that points at a property of a type (a reference whose existence and type the compiler checks). Passing it where a function goes makes map and sort concise, and KVO and SwiftUI identify properties with it.
SwiftShort answerIntro
Take ["a", "b", "c"] as input and produce ["c-0", "b-1", "a-2"]. You can't use a for…
#functional
ArchitectureShort answerIntro
Can you explain the Delegate pattern that shows up all over UIKit?
#kvo
ArchitectureShort answerBasics
How does KVO in the Objective-C runtime detect property changes under the hood?
#kvo
CS fundamentals and algorithmsMultiple choiceBasics
Which of these are pure functions (same output for the same input, no side effects)?…
#functional