What's the difference between @State and @StateObject – Ios swift
I created a model like this import Foundation class Play:ObservableObject{ @Published var name:String="Tayle" @Published var age:Int=12 } It will be used in two views For example: struct Demo: View { //1 @State private var play:Play = Play() //2 //@StateObject private…