title: Setting closure on other view controller with parameters
body: <p>I have view controller A that presents view controller B as a popover. What I'm trying to do is to get a value that's set in view controller B, back in view controller A.</p>
  
  <p>My thought is that I would accomplish this by passing in a closure that takes a parameter and having view controller B calling that with the parameter.</p>
  
  <p>So, in VC A, I have:</p>
  
  <pre><code>func update(val:String) {
  }
  </code></pre>
  
  <p>Then, when I create VC B, I tried:</p>
  
  <pre><code>bVC.notifier = update
  </code></pre>
  
  <p>but I'm getting error:</p>
  
  <pre><code>Cannot assign value of type '(String, String) -&gt; ()' to type '() -&gt; {}'
  </code></pre>
  
  <p>Then, in view controller B:</p>
  
  <pre><code>public var notifier = {}
  </code></pre>
  
  <p>then I'm not really sure how to call it.</p>
  
  <p>I've read through: <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-ID94" rel="nofollow noreferrer">https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-ID94</a> but don't think it covered this situation very well.</p>