0

My problem is demonstrated in this gif:

enter image description here

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: enter image description here

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?

Oscar Apeland
  • 5,952
  • 5
  • 39
  • 85

1 Answers1

1

I've attempted to duplicate, but did not get the gray box upon loading. Instead, it worked as you had intended -- the sidebar loading upon app launch.

I found some similar questions that might provide you with some insight:

Community
  • 1
  • 1
weliver
  • 26
  • 4