SplitViewController changed in iOS9 - can't access detail ViewController

When moving my SplitViewController to iOS9 support using the Xcode 7 beta, I found I could no longer access the detail view controller with my existing code.

My original code looked like this:
(DetailViewController is the subclass I have applied to the detail view controller in my storyboard).

if let controllers = self.splitViewController?.viewControllers {

    for  aController in controllers {

        if let detailViewController = aController.navigationController?.topViewController as? DetailViewController {

            self.myMasterTable?.detailViewController = detailViewController

            return
        }
    }
}

What I realized by printing "aController" in the above code is that splitViewController?.viewControllers returns an array of UINavigationViewControllers now instead of just UIViewControllers!

So the below code should work for both iOS9 & iOS8:

if let controllers = self.splitViewController?.viewControllers {

    for  aController in controllers {

        if let detailViewController = aController.navigationController?.topViewController as? DetailViewController {

            self.myMasterTable?.detailViewController = detailViewController

            return

        }else if let navViewController = aController as? UINavigationController {

            if let detailViewController = navViewController.topViewController as? DetailViewController {
                self.myMasterTable?.detailViewController = detailViewController

                return
            }
        }
    }
}

Hope this helped! What other wierd stuff are you seeing in the latest beta releases from Apple?

Jeremy