title: Noob Swift UI question - Updating views from model class
body: <p>I have my ItemModel and my Contentview, but when run the program the view doesn't update with the new quantity in real time. How do I get the model and the view to &quot;talk&quot;</p>
  <pre><code>import Foundation
  import SwiftUI
  
  class Item: ObservableObject {
      var name: String
      @Published var qty: Int
      
  
      init(name: String, qty: Int) {
          self.name = name
          self.qty = qty
      }
      
  }
  
  var metzScissor = Item(name: &quot;Metz Scissor&quot;, qty: 5)
  </code></pre>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      
      var body: some View {
          
          NavigationView {
          
          VStack {
              Text(&quot;Items In Stock&quot;)
                  .font(.title)
                  .padding()
              Spacer()
              NavigationLink (
                  destination: ItemDetailView(),
               label: {
                   Text(metzScissor.name)
              })
              Spacer()
              }
          }
      }
  }
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>
  <p>Do I need to make an instance of my model class within the view file?</p>