Skip to content
Programmatically create tabs in NSWindow without using the built-in stuff of NSDocument
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
MultiTabbed.xcodeproj use dedicated NSStoryboard for WindowController Jul 20, 2019
MultiTabbed more gracefully handle tab creation from AppDelegate Jul 20, 2019
LICENSE add LICENSE and README Jul 20, 2019

Programmatic NSWindow Tabbing

Swift 5.0 License Platform

Demonstrating how to implement programmatic creation of tabs in NSWindows without the use of NSDocument.

  • Checkout the shared-window-controller tag to see how to re-use a single NSWindowController for all tabs as per my blog post. Don't use this in production, though.
  • Checkout the multiple-window-controllers tag or the current master branch to see how to manage NSWindowControllers for your tabs.

The underlying difficulty people on StackOverflow etc. are experiencing is that creating your NSWindowController from a storyboard will initialize the window contents, but you need to keep the window controller itself alive to respond to main menu actions. Otherwise, the "+" (add tab) button will appear broken for all but the initial tab.


Copyright (c) 2019 Christian Tietze. Distributed under the MIT License.

You can’t perform that action at this time.