UISplitViewController within UITabbarController Swift

Okay i have a Universal single view application with a UITabbarController as the initial ViewController. i have a UISplitViewController as an item in one of the tabs. the SplitViewController has a navigationController as its master segue, which has a viewController with a uitableView in it and if you click a cell it “shows” the detail view (I’ve tried the show detail segue also). the splitViewControllers detail view controller segue goes to the detail view controller.
my problem is when i go to the tab with the splitViewController in it it shows the detail first and not the master(same for both ipad and iphone). i have spent hours reading and watching different tutorials and looking at questions on here and cant find a solution.

code i have tried(in a custom split viewcontroller class and viewcontroller with the tableView class):

  • How do you debug on breakpoints in swift on xcode?
  • How to convert all image format into .png format?
  • Why my NSDateFormatter returns null?
  • Layout issues after updating to Xcode 8
  • URL of image after UIImageWriteToSavedPhotosAlbum in Swift
  • Xcode attempted to locate or generate matching signing assets and failed to do so
  • func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController, ontoPrimaryViewController primaryViewController: UIViewController) -> Bool {
        return true
    override func viewWillAppear(animated: Bool) {
        splitViewController?.delegate = self
        self.splitViewController!.delegate = self;
        self.splitViewController!.preferredDisplayMode = UISplitViewControllerDisplayMode.AllVisible
        if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
            if let con = self.splitViewController {
                con.preferredDisplayMode = .PrimaryOverlay
                //^this code doesnt run when i run it on my iphone
        } else if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
            if let spec = self.splitViewController {
                spec.preferredDisplayMode = .AllVisible
        } else {
            if let tit = self.splitViewController {
                tit.preferredDisplayMode = .Automatic
    //controller with tableView class declaration
    class OutfitTable : UIViewController, UITableViewDelegate, UITableViewDataSource, UISplitViewControllerDelegate {
    //custom splitViewController class declaration
    class SplitViewController: UISplitViewController, UISplitViewControllerDelegate

    screenshot of main storyboard:
    enter image description here

    im sorry if this is unnecessarily descriptive i just want to make sure i get all the information out there.

    Anything helps. Thank You in advance