title: Cannot assign to property: 'self' is immutable while assigning value to @ObservedObject
body: <pre><code>struct ParentView: View {
    @ObservedObject var selectedFruit:Fruit
    @State var showingSheet = false
  
    var body: some View {
          VStack {
              HStack(spacing:0.6) {
                  ForEach(self.viewModel.fruits, id: \.id) { record in
                      Text(record).onTapGesture {
                          self.selectedFruit = Fruit() //Cannot assign to property: 'self' is immutable
                          self.showingSheet.toggle()
                      }
                  }
               }
  
          }.sheet(isPresented: $showingSheet,onDismiss: {
                  print("reload?")
          }) { 
               DetailView(fruit: self.selectedFruit)
          }
     }
  }  
  
  
  
  
  struct DetailView: View {
      @ObservedObject var fruit: Fruit
      var body: some View {
          Text(fruit.text)
      }
  }
  </code></pre>
  
  <p>When I try to assign value to the observable <code>selectedFruit</code> from <code>ParentView</code>, I get the following compile error:</p>
  
  <blockquote>
    <p>Cannot assign to property: 'self' is immutable</p>
  </blockquote>
  
  <p>But if I replace <code>@ObservedObject</code> with <code>@State</code>, it works. How can I make it work with <code>@ObservedObject</code>? I'm worried, if I go with @State, the update I make on that object on <code>DetailView</code> will not trigger update on <code>ParentView</code>.</p>
  
  <p>Can someone help me on this?</p>