0

I am creating a code editor for Mac using Xcode and Swift. I already have a toolbar (NSToolbar) but am not sure how I would achieve a tab design simmilar to Firefox's. I don't want to use NSTabView as those are more like tabbed buttons, and I am looking for a proper tab bar for Mac.

Example of what I want to achieve

In the below image, I have edited the tab bar from Firefox into the design of the app so you can see what I would like to accomplish.

enter image description here

Will I have to implement something like this from scratch, and if so - how would I go about doing it? Thanks, dhilln.

dhilln
  • 56
  • 3
  • You get Cocoa tabs like in Xcode or Finder in macOS 10.12+ for free, but you have to develop those custom (in my opinion ugly *windows-ish*) tabs yourself. – vadian Dec 24 '18 at 20:12
  • @vadian I would prefer the native tabs if possible, but I am not using an NSDocument setup - is there a way to get those without NSDocument? I have implemented `override func newWindowForTab(_ sender: Any?)` in my MainWindowController (extension of NSWindowController) as I tried this after some quick Googling but there still is no tab bar. – dhilln Dec 24 '18 at 20:18
  • I don't know please watch the WWDC video about Cocoa from 2016 when 10.12 was introduced. – vadian Dec 24 '18 at 20:20
  • All it says is this, which is what I've tried to no avail. "Non-NSDocument can enable the plus button by implenting newWindowForTab" – dhilln Dec 24 '18 at 20:21
  • @vadian Never mind, I'll try and just see if I can remake it as an NSDocument based then – dhilln Dec 24 '18 at 20:29
  • you dont need to use doc. you just need a plist setting. – aehlke Feb 14 '23 at 17:31

0 Answers0