4 ms·
I really like the struct-based method of modeling data in Swift. The language makes this very convenient. Unfortunately the new Observation framework which is a
by cageface 3y ago
I really like the struct-based method of modeling data in Swift. The language makes this very convenient. Unfortunately the new Observation framework which is at the center of SwiftUI requires classes.
https://forums.swift.org/t/any-future-directions-for-supporting-observable-structs/69870 https://forums.swift.org/t/any-future-directions-for-support...
- amomchilov 3y agoThis makes sense, observation requires a durable identity, which structs don’t have. Two struct might be the same, but when I observe for changes in one, but not another, a distinction arises which is best captured by object-based identity