The @Observable Macro
Make a class observable so views track it.
The Problem to Solve
A plain model class holds data, but SwiftUI will not redraw when that data changes. We need to make the class observable.
Meet @Observable
The @Observable macro marks a class so SwiftUI watches its properties and refreshes any view that reads them. ✨
@Observable
class Counter {
var count = 0
}