title: UISplitViewController in Swift navigation from DetailView
body: <p>I'm trying to create a MasterDetail Application in Swift and it's running well on iOS8 Simulator. However, when I tried it on my iOS 7.1 iPad I got this error:</p>
  
  <pre><code>**Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-    [UISplitViewController displayModeButtonItem]: unrecognized selector sent to instance**
  </code></pre>
  
  <p>This is in my AppDelegate.swift file(generated by Xcode, I didn't add anything):</p>
  
  <pre><code>func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
      // Override point for customization after application launch.
      let splitViewController = self.window!.rootViewController as UISplitViewController
      let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as UINavigationController
      navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
      splitViewController.delegate = self
  
      let masterNavigationController = splitViewController.viewControllers[0] as UINavigationController
      let controller = masterNavigationController.topViewController as MasterViewController
      controller.managedObjectContext = self.managedObjectContext
      return true
  }
  </code></pre>
  
  <p>The problem comes from this line where the left button is created:</p>
  
  <pre><code>navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
  </code></pre>
  
  <p>When I remove this line, it runs on iOS 7 but displays only the DetailView. When I swipe from the left edge the MasterView doesn't appear(on iOS 8 simulator it does) and basically there is no navigation to the MasterView</p>
  
  <p>Had anyone have the same problem?</p>
  
  <p>Thank you!</p>