title: Why is parameter for onChange(of:perform:) captured?
body: <p>I was using the <a href="https://developer.apple.com/documentation/swiftui/view/onchange(of:perform:)" rel="nofollow noreferrer"><code>onChange(of:perform:)</code></a> SwiftUI modifier. I then wanted to get the old value, to compare it with the new value. I read the documentation, which says:</p>
  <blockquote>
  <p>The previous value may be captured by the closure to compare it to the new value.</p>
  </blockquote>
  <p>With an example:</p>
  <pre><code>.onChange(of: playState) { [playState] newState in
      model.playStateDidChange(from: playState, to: newState)
  }
  </code></pre>
  <p>My question is why in the example is <code>playState</code> captured in the <code>[ ]</code>? The <code>playState</code> value could easily be accessed without passing it in. In addition, this isn't part of a class, so I assume there is no way to create a strong reference by capturing <code>self</code> of some sort.</p>
  <p>Why is the example written like this?</p>