My problem is demonstrated in this gif:
As you can see in the first frames, i get a gray box on my first interaction. The background view is red just to check if it was loaded.
My storyboard is set up like this:
The only modifications I've made in code is this in the SplitViewController class:
class SplitViewController: UISplitViewController, UISplitViewControllerDelegate {
var collapseDetailViewController = true
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
self.preferredDisplayMode = .PrimaryOverlay
}
func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController, ontoPrimaryViewController primaryViewController: UIViewController) -> Bool{
return collapseDetailViewController
}
}
and this in my master tableview
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
(splitViewController as! SplitViewController).collapseDetailViewController = false
}
This is because I want the sidebar to show up when the user launches my app. Have anyone experienced this weird error before, and does anyone know how to fix it?