title: SwiftUI - is it possible to get didSet to fire when changing a @Published struct?
body: <p>I have just updated to XCode 11.4 and some of my code has stopped working. I have some <code>@Published</code> struct variables in an <code>ObservableObject</code>. Previously, when I updated properties on the struct, the <code>didSet</code> method would fire on the published property, but that's not the case anymore. Is it possible that this behaviour has changed by design in the latest update to Swift?</p>
  
  <p>Here's a trivial example:</p>
  
  <pre class="lang-swift prettyprint-override"><code>
  import SwiftUI
  
  struct PaddingRect {
    var left: CGFloat = 20
    var right: CGFloat = 20
  }
  
  final class SomeStore : ObservableObject {
    @Published var someOtherValue: String = "Waiting for didSet"
  
    @Published var paddingRect:PaddingRect = PaddingRect() {
      didSet {
        someOtherValue = "didSet fired"
      }
    }
  }
  
  struct ObserverIssue: View {
    @ObservedObject var store = SomeStore()
  
    var body: some View {
      VStack {
        Spacer()
  
        Rectangle()
          .fill(Color.yellow)
          .padding(.leading, store.paddingRect.left)
          .padding(.trailing, store.paddingRect.right)
          .frame(height: 100)
  
        Text(store.someOtherValue)
  
        HStack {
          Button(action: {
            // This doesn't call didSet
            self.store.paddingRect.left += 20
  
            // This does call didSet, ie. setting the whole thing
  //          self.store.paddingRect = PaddingRect(
  //            left: self.store.paddingRect.left + 20,
  //            right: self.store.paddingRect.right
  //          )
  
          }) {
            Text("Padding left +20")
          }
  
          Button(action: {
            self.store.paddingRect.right += 20
          }) {
            Text("Padding right +20")
          }
        }
  
        Spacer()
      }
    }
  }
  
  struct ObserverIssue_Previews: PreviewProvider {
      static var previews: some View {
          ObserverIssue()
      }
  }
  
  </code></pre>
  
  <p>The property updates, but <code>didSet</code> does not fire.</p>
  
  <p>Is it possible to get nested properties of a struct to trigger the <code>didSet</code> method of the publisher?</p>