title: Call function in another ViewController (macOS)
body: <p>How can I communicate with another View Controller on Xcode Storyboards in any possible way?</p>
  <p>Given the principle of encapsulation, the preferred way seems to be to call a function in the other ViewController.</p>
  <p>(failed) ideas:</p>
  <ul>
  <li>Using self.storyboard to <a href="https://developer.apple.com/documentation/appkit/nsstoryboard/1426549-instantiatecontroller" rel="nofollow noreferrer">instantiate a Controller</a> with the specified Identifier, casting it to the correct View Controller subclass</li>
  <li>instantiating the view controller with <code>let c = specialViewController()</code> [doesn't work because the instance's views haven't loaded]</li>
  <li>connecting an IBOutlet to another NSViewController subclass [this one should work but doesn't]</li>
  </ul>
  <p>Note: iOS solutions often are not the same as MacOS solutions</p>
  <p>First failed idea code:</p>
  <pre><code>let spec_ref = self.storyboard!.instantiateController(withIdentifier: &quot;specialSettings&quot;) as! SpecialSettings
   spec_ref.save_spec_settings();
  </code></pre>
  <p>save_spec_function:
  <a href="https://i.stack.imgur.com/qxyCZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qxyCZ.png" alt="enter image description here" /></a></p>
  <p>The spec_ref still cannot access IBOutlets in the other ViewController on the Storyboard, so it must not be the correct instance.</p>