title: How to load a detailed view controller (from split view) on start up in swift?
body: <p>When my app starts for the first time on an iPad simulator, the mainVC table loads and lists data from my model, but the detail view controller doesn't. It only loads and lists data from the storyboard. I'd like it to list the first item from the main menu (for example).</p>
  
  <p>I saw this done in a RayW tutorial from the AppDelegate method, didFinishLaunchingWithOptions, but they didn't use the default split view code, but rather re-created it from scratch with some variation from the default code. This is how they did it:</p>
  
  <pre><code>let splitViewController = self.window!.rootViewController as! UISplitViewController
  let leftNavController = splitViewController.viewControllers.first as! UINavigationController
  let masterViewController = leftNavController.topViewController as! MasterViewController
  let detailViewController = splitViewController.viewControllers.last as! DetailViewController 
  let firstMonster = masterViewController.monsters.first
  detailViewController.monster = firstMonster
  return true
  </code></pre>
  
  <p>The following is the default code plus (after the empty line) an attempt to reconcile the default code with the above method.</p>
  
  <pre><code>    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
      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 leftNavController = splitViewController.viewControllers.first as! UINavigationController
      let masterViewController = leftNavController.topViewController as! MasterViewController
      let detailViewController = navigationController.topViewController as! DetailViewController
      let firstRecord = masterViewController.records.first
      detailViewController.record = firstRecord
  
      return true
  }
  </code></pre>
  
  <p>In my initial attempts, I was casting around the wrong controllers, but the above code at least compiles and runs, but it does not load the first record into the detailVC.</p>
  
  <p>Is this the right approach and I am just missing something, or is there another way to do this? </p>