At min 21 into the video Bring Core Data concurrency to Swift and SwiftUI, Scott entered
@State private var selectedSort = SelectedSort()
Why is he not using @StateObject? I would have expected @StateObject is the way to go here as we are creating the SelectedSort() within the View. Because we want to tell SwiftUI to reserve storage for this property and keep it across view updates.
I would expect that using @State would mean that our SelectedSort() is re-created whenever the View is re-created, with the effect that sorting reverts to default.
What is the correct way to do it and why?