title: Passing variables from two NSWindows in Swift
body: <p>I am trying to update a label in an NSViewController from a NSWindowController.</p>
  
  <p>Here is what I've done.</p>
  
  <p>Created a protocol:</p>
  
  <pre><code>protocol PopoverProtocol: class {
      func SearchForIt(Query:String)
  }
  </code></pre>
  
  <p>Created a function to update the label in the NSViewController</p>
  
  <pre><code>class PopoverController: NSViewController, PopoverProtocol {
  
      @IBOutlet weak var Label: NSTextField!
  
      func SearchForIt(Query:String){
              Label.stringValue = Query
      }
  }
  </code></pre>
  
  <p>Called the protocol and function from the NSWindowController</p>
  
  <pre><code>class TutorialViewController: NSWindowController, NSSearchFieldDelegate {
  
      weak var responder : PopoverProtocol?
  
      @IBAction override func controlTextDidChange(obj: NSNotification) {
  
      PopoVer.showRelativeToRect(SearchField.bounds, ofView: SearchField, preferredEdge: NSRectEdge.MinY)
  
      responder?.SearchForIt(SearchField.stringValue)
  
      }
  }
  </code></pre>
  
  <p>However nothing is happening. I am not getting any error messages, the function <code>SearchForIt</code> is just not being called.</p>
  
  <p>Any ideas on what I am doing wrong ? Thank you for your help !</p>