title: Dismissing Modal View Swift
body: <p>EDIT: Thanks to the person behind the answer below, who fixed the unknown class. However, can anyone tell me if the code to dismiss is correct? I am on vacation and can't program until I get back.</p>
  
  <p>I am developing an app in Swift. Currently, I am working on an info screen (legal notices, credits, documentation, etc)  that will be presented modally atop the main screen.</p>
  
  <p>The expected behavior is that, when a button press triggers <code>Dismiss</code> in <code>InfoViewController</code>, the modal view controller is dismissed.</p>
  
  <p>Here’s the code I’m trying to use:</p>
  
  <pre><code>//This is InfoViewController, the swift file used to conorol the info screen.
  
  import UIKit
  
  class InfoViewController: UIViewController {
  
      @IBAction func Dismiss(sender: AnyObject) {
          self.dismissViewControllerAnimated(true, completion: {});//This is intended to dismiss the Info sceen.
          println("pressed")
      }
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
  }
  </code></pre>
  
  <p>Here’s the layout of the storyboards:</p>
  
  <p><img src="https://i.stack.imgur.com/iSh4a.jpg" alt="postimg.org/image/wbozsmtr3/"></p>
  
  <p>When I press the button, the app crashes and doesn’t dismiss the modal view controller.</p>
  
  <p>It compiles, suggesting it is not a syntactual error. </p>
  
  <p>Here’s the LLVM debugger output: </p>
  
  <blockquote>
    <p>2014-08-30 20:02:20.571 CryptoCalc[799:244086] 17545849:_UIScreenEdgePanRecognizerEdgeSettings.edgeRegionSize=13.000000
    //Unrelated stuff deleted.
    2014-08-30 20:03:03.756 CryptoCalc[799:244086] Unknown class InfoViewController in Interface Builder file.
    2014-08-30 20:03:20.485 CryptoCalc[799:244086] -[UIViewController Dismiss:]: unrecognized selector sent to instance 0x14d57990
    2014-08-30 20:03:20.489 CryptoCalc[799:244086] <strong>* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController Dismiss:]: unrecognized selector sent to instance 0x14d57990'
    *</strong> First throw call stack:
    (0x2238be2f 0x2f46bc8b 0x22391179 0x2238f097 0x222c11f8 0x259b9fef 0x259b9f91 0x259a4d13 0x259b99fd 0x259b96d7 0x259b2fa1 0x25989a09 0x25bfbae3 0x259884a1 0x2235257f 0x2235198f 0x2234fff5 0x2229e611 0x2229e423 0x297f80a9 0x259e8485 0x73720 0x7375c 0x2f9f1aaf)
    libc++abi.dylib: terminating with uncaught exception of type NSException</p>
  </blockquote>
  
  <p>If you need any more info, let me know. Thanks so much.</p>