Making Inspector Sidebar in macOS Window

Finally I solved the issue. I had to add a CustomView to each of the tab’s CustomViews. This way, Xcode added ViewControllers automatically. Here are the individual steps:

First, I had to insert a SplitView into the storyboard. Nothing problematic here yet.

SplitView

Second, I’ve added a TabView (Style: tabless) into one of the CustomViews:

SplitView with TabView

And third, I needed to add ContainerViews to each of the tabs:

SplitView with TabViews with ContainerViews

This way Xcode added ViewControllers for each of the tab’s ContainerViews:

enter image description here

No I can chose the different Tabs programmatically:

@IBAction func showInspector1(_ sender: NSButton) {
    self.tabView.selectTabViewItem(at: 0)
}
@IBAction func showInspector2(_ sender: NSButton) {
    self.tabView.selectTabViewItem(at: 1)
}

I would like to thank for the comments, that helped me making progress and solving this issue.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top