1

I am using storyboard to create a window controller with a NSToolbar. Using the toolbar buttons I'm trying to switch the contentViewController of the window to other viewControllers.

  @IBAction func switchViewControllers(sender: NSToolbarItem) {

    if sender.label == "one" {
        self.window?.contentViewController = self.storyboard?.instantiateControllerWithIdentifier("one") as? NSViewController
    }
    if sender.label == "two" {
        self.window?.contentViewController = self.storyboard?.instantiateControllerWithIdentifier("two") as? NSViewController
    }

}

Clicking on the toolbarItems switches the ViewControllers as expected but I am noticing some graphic glitches at the edges of the window when switching thew ViewControllers.

Am I missing something?

Startup original

When switching views switch1

switch2

Mike Nathas
  • 1,247
  • 2
  • 11
  • 29
  • 1
    Similar question: [NSSplitViewController causing contained views to draw over window corners](http://stackoverflow.com/questions/36464339/nssplitviewcontroller-causing-contained-views-to-draw-over-window-corners) – Willeke Apr 30 '16 at 22:37

0 Answers0