SwifUI onAppear gets called twice
I had the same exact issue. What I did was the following: struct ContentView: View { @State var didAppear = false @State var appearCount = 0 var body: some View { Text(“Appeared Count: \(appearrCount)” .onAppear(perform: onLoad) } func onLoad() { if !didAppear { appearCount += 1 //This is where I loaded my coreData information into … Read more