Back to blog

5 Quick Tips for the Xcode 11 Minimap


Aasif Khan
By Aasif Khan | December 27, 2021 6:08 pm  | 4-min read

Xcode 11 introduced a useful feature: the code editor now has a mini map. The minimap shows an overview of your code, that you can scroll through. And, as we’ll discuss in this tutorial, it has a ton of super-useful-but-slightly-hidden features.

We’ll discuss 5 quick tips for using the minimap in Xcode 11:

  • Hover over the minimap to see functions, classes, properties, etc.
  • Hold Command to see a quick list of functions, classes, etc.
  • Click-and-hold inside the minimap to quickly scroll through your code
  • Organize your file better with // MARK: comments; they show in the minimap
  • Search a file for keywords, and the minimap shows you where they are

See Classes, Functions, Properties on Hover

The purpose of the minimap is to show you a global outline of the code, and to help you navigate your code better. You could view the mini map as a birds-eye view of your code.

If you look closely, you’ll see that the minimap actually uses the same colors and syntax highlighting as the editor itself. The same goes for changes (Git) in your code, and breakpoints, and even the current cursor position. All that is visible in the minimap!

OK, now hover over the minimap with the mouse cursor. As you move over properties, functions, classes, etc., their names show up on top of the minimap. When you click the hovered-over item, the editor moves over to that part of your code. This helps you navigate your code.

Hold «Command» to See a List of Functions

Another great feature is this: as you hover over the minimap, hold the Command key. This will display a list of all the classes, functions, properties, types, etc. in the current Swift file.

And there’s more!

  • You can click an item in the list, and the editor will then skip to that part of your code.
  • Right now, // MARK: style code comments will also show up in the list (see below)
  • This list is similar to the one found at the top of the editor, at the end of the breadcrumb

The minimap is essentially one huge scrollbar. Try it for yourself: move your mouse over to the mini map, then click-and-drag. This will scroll the code editor, just like a normal scrollbar would. Neat!

Organize Your Code with “MARK” Comments

In Swift code files, you can use a few kinds of code comments to document your code. One of them is // MARK:, previously called #pragma mark in Objective-C. Its siblings are // FIXME: and // TODO:.

The cool thing about these types of code comments, is that they show up in the minimap as well. You can quickly get an overview of parts of your code, if you comment it that way.

The syntax is simple:

// MARK: Whatever you type here

Right now, // FIXME: and // TODO: won’t show up in the mini map, but they probably will in the future. The list at the end of the breadcrumb, atop the editor, does show these fixmes and todos, though.

See Search & Find Keywords at a Glance

The last quick tip for the Xcode 11 minimap involves Search & Find in Xcode. You can search your Swift file for text by pressing Command + F, and use Search and Replace with Command + Option + F.

Xcode will automatically search closest to your cursor position first, which means it’s easy to lose your place in a code file as you continue searching for other occurrences. The minimap helps here:

It’ll highlight occurrences of your search string in the minimap, so you can see where a keyword is at a global level. Neat!

Note in the above screenshot that the minimap is really accurate. The currently highlighted search occurrence shows up in yellow in the editor, and it’s also displayed as yellow in the minimap. In fact, the minimap is an actual color representation of all the code in the file. Neat!

Further Reading

The new minimap in Xcode proves to be quite useful for navigation in a Swift code file, and helps you get a global outline of your code. Here are the quick tips we discussed once more:

  • Hover over the minimap to see functions, classes, properties, etc.
  • Hold Command to see a quick list of functions, classes, etc.
  • Click-and-hold inside the minimap to quickly scroll through your code
  • Organize your file better with // MARK: comments; they show in the minimap
  • Search a file for keywords, and the minimap shows you where they are


Aasif Khan

Head of SEO at Appy Pie

App Builder

Most Popular Posts