Update State-variable Whenever CoreData is Updated in SwiftUI
问题 After updating some data from CoreData, I also want to update a State -variable to the number of returned results. When CoreData is changed, the Stepper should always be set to the number of returned results. However, onAppear fires also when I use the Stepper . How can I check in onAppear whether CoreData was changed or the Stepper was used? Is that even possible? import SwiftUI struct ContentView: View { @State var numberOfResults = 0 @FetchRequest(entity: YourModel.entity(),