Two levels of tab bar for tab grouping

Xcode 12 has an all new tab system. Here’s how I use it to organise my workflow!

Window tabs, document tabs, tabs vs. spaces…

This really confused me at first. There are now 2 different types of tab: window and document. These appear on 2 seperate tab bars, one under the other… it looks weird but it’s great for organising your workflow!

Here’s how I use it.

Window tabs

At the top, I organise my work by topic using window tabs:

Window tabs

It makes more sense to think of window tabs as folders, and under each folder you can keep a bunch of documents open. I tend to split things up something like this:

  • Project for the project settings, info.plist, etc.
  • UI for interface related files
  • Code files for whatever I’m working on currently
  • Debug for debugging so the debugger doesn’t mess with my active editor

Of course you can use whatever setup suits you.

Document tabs

Document tabs

Under the window tabs, I use document tabs to keep all files I’m working on open. This lets me switch quickly between files, and the hierarchy of Window and Document tabs keeps things organised, so I can have 50 tabs open but still be able to find what I’m after quickly.

How to set it up

Window tabs

  1. Turn on the Window Tab Bar from the View menu, if it’s not already visible: Turn on the window tab bar

  2. Add a few tabs with the + button at the end of the window tab bar, as many as you need.

  3. Rename the tabs. You can use the Window menu (Rename Window Tab) or press ⌥⇧⌘t.

Document tabs

There’s an important thing to know when you open a file:

  • Single-clicking a file will open it temporarily. If you click on a different file, it’ll open it in the same tab.
  • Double-clicking a file makes it permanent. If you click on another file, it’ll open in a new tab, keeping the first document open.

This is really handy: double click to open files you’re actively working on, and you’ll quickly have a useful set of tabs. When you just need a file open briefly and won’t come back to it, single click.

You can change this in the prefs, under Navigation.

A little Debug tab magic

It’s frustrating to run your code, then hit a breakpoint or crash and have Xcode switch to another file and start the debugger, causing you to lose your place and your window layout.

You can fix this! Use the Behaviours preferences to tell Xcode to switch to the Debug tab when it pauses, or when the build fails:

Configuring debug behaviour

You can set this up for failed tests, frame capture etc. when you want it to switch to the Debug tab too.