4 ms·
Use of class was strongly discouraged in the Swift world until they rolled out their new Observation framework for SwiftUI that requires using classes for model
by cageface 3y ago
Use of class was strongly discouraged in the Swift world until they rolled out their new Observation framework for SwiftUI that requires using classes for modeling state and depends on two-way data binding to work. So all the arguments we've been hearing for years about the benefits of structs, immutable data, and controlled updates got tossed out the window.
This was bad timing with the switch to strong concurrency checking in Swift 6 because doing strong concurrency handling in a world of reference types and two way binding is really painful.