title: iOS Swift. Capturing properties inside Closure in struct constructor
body: <p>I got some issue with closure/struct/capturing properties.</p>
  
  <p>I can't really explain the architecture but i need to have something like this:</p>
  
  <pre><code>class ControllerAAA {
      struct Events {
          var userDidSelect(_ controller: Controller) -&gt; ()?
      }
  }
  
  class ControllerBBB {
      var foo: Foo
  
      var events: ControllerAAA.Events(userDidSelect: {
          (controller: Controller) -&gt; ()? in
           // Here i need foo. Self mean the Block not the Controller
      })
  
      // Then i will passed events when i call ControllerAAA and ControllerAAA will use events.userDidSelect(...) when he is done.
  }
  </code></pre>
  
  <p>Is it possible to reach “self” in closure that is in struct constructor defined in class?</p>