title: Can a Swift Property Wrapper reference the owner of the property its wrapping?
body: <p>From within a property wrapper in Swift, can you someone refer back to the instance of the class or struck that owns the property being wrapped? Using <code>self</code> doesn't obviously work, nor does <code>super</code>. </p>
  
  <p>I tried to pass in <code>self</code> to the property wrapper's <code>init()</code> but that doesn't work either because <code>self</code> on <code>Configuration</code> is not yet defined when <code>@propertywrapper</code> is evaluated.</p>
  
  <p>My use case is in a class for managing a large number of settings or configurations. If any property is changed, I just want to notify interested parties that <em>something</em> changed. They don't really need to know which value just, so use something like <code>KVO</code> or a <code>Publisher</code> for each property isn't really necessary.</p>
  
  <p>A property wrapper looks ideal, but I can't figure out how to pass in some sort of reference to the owning instance that the wrapper can call back to.</p>
  
  <p>References: </p>
  
  <p><a href="https://github.com/DougGregor/swift-evolution/blob/property-wrappers/proposals/0258-property-wrappers.md" rel="noreferrer">SE-0258</a></p>
  
  <pre><code>enum PropertyIdentifier {
    case backgroundColor
    case textColor
  }
  
  @propertyWrapper
  struct Recorded&lt;T&gt; {
    let identifier:PropertyIdentifier
    var _value: T
  
    init(_ identifier:PropertyIdentifier, defaultValue: T) {
      self.identifier = identifier
      self._value = defaultValue
    }
  
    var value: T {
      get {  _value }
      set {
        _value = newValue
  
        // How to callback to Configuration.propertyWasSet()?
        //
        // [self/super/...].propertyWasSet(identifier)
      }
    }
  }
  
  struct Configuration {
  
    @Recorded(.backgroundColor, defaultValue:NSColor.white)
    var backgroundColor:NSColor
  
    @Recorded(.textColor, defaultValue:NSColor.black)
    var textColor:NSColor
  
    func propertyWasSet(_ identifier:PropertyIdentifier) {
      // Do something...
    }
  }
  </code></pre>