title: Dismissing View Controller for osx
body: <p>I'm trying to learn swift code for mac OSX but there isn't much tutorials for it as ios. and i have been struggling already with closing or dismissing the view controller when i launch through a button another connected view controller </p>
  
  <pre><code>class ViewController: NSViewController {
  
  @IBOutlet weak var username: NSTextField!
  @IBOutlet weak var password: NSTextField!
  @IBAction func login(sender: AnyObject) {
  }
  
  
  @IBAction func signUp(sender: AnyObject) {
  
  
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view.
  }
  
  override var representedObject: AnyObject? {
      didSet {
      // Update the view, if already loaded.
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I tried to add [self dismissModalViewControllerAnimated:YES]; to dismiss it but it doesn't work it only shows errors. if anybody could point me to somewhere i can get more information or what i'm doing wrong?</p>