title: Changing IBOutlet in UIViewController from UIWindow in Swift
body: <p>I have a <code>UIViewController</code> with some <code>IBOutlets</code>. I also have a <code>UIWindow</code> that needs to access those <code>IBOutlets</code> in the first <code>UIViewController</code>. However, whenever I try to access it from my <code>UIWindow</code>, the variables are <code>nil</code>. Here's some of my code.</p>
  
  <pre><code>class ViewController: UIViewController {
  
      @IBOutlet weak var playPauseLabel: UILabel!
      @IBOutlet weak var playButton: UIButton!
      @IBOutlet weak var pauseButton: UIButton!
  
      func functionA() {
          println(playPauseLabel)
          println(playButton)
          println(pauseButton)
      }
  }
  
  class WindowClass: UIWindow {
  
      func resetPlayPause() {
  
          var vc = ViewController()
          vc.functionA()
  
      }
  
  }
  </code></pre>
  
  <p>Now when I call <code>func resetPlayPause()</code> from <code>WindowClass</code>, all three <code>IBOutlets</code> are nil. I've read around on the other SO threads on this issue but haven't found any solutions. How can I access and modify those <code>IBOutlets</code> in <code>ViewController</code> from <code>WindowClass</code>?</p>