chipbk10 / iOSInterview

0 stars 0 forks source link

SwiftUI #6

Open chipbk10 opened 11 months ago

chipbk10 commented 11 months ago

Source

chipbk10 commented 11 months ago

Questions

abhijitmaiti commented 10 months ago
  1. @State is use when we have to observe primitive thing like string,bool etc

  2. Suppose we have two view A And B and a have string and we have to change the String in view A by View B then @Binding is use

  3. Wnen we have to observe classes then we will use @ObervedObject

  4. @Environment is use when your view is dependent on type that is cannot conform to ObservableObject