Using keyboard shortcuts is key of being productive and efficient when working with a development environment like Xcode. In this article, I'll show you my favorite Xcode shortcuts.

Before we start, here is a quick key reference:

Let's jump in.

Sponsorship logo

Architecture & Design Patterns for iOS

This book is a practical guide to essential architectural principles and design patterns for iOS development. It covers strategies for building maintainable apps with Swift and SwiftUI, including dependency injection, navigation, common patterns, and modularization.

LEARN MORE

1. Product

Let's start with some basic shortcuts which we can find in Xcode's Product menu:

If you are working with Xcode for some time now, you most certainly use them already.

2. Navigate

Quickly navigating back and forth when working on different files is a real time saver:

3. Open quickly and jump to definition

Another essential shortcut is one for opening a file quickly with ⇧ ⌘ O.

After doing so, the jump to definition ⌃ ⌘ J shortcut comes in handy to jump to that file in the project navigator.

4. Find

Whether it's within the currently opened file or throughout the project/workspace, searching is another essential action:

5. View

Being able to show and hide different Xcode areas quickly is really useful especially when working on smaller screens:

  • ⌘ 0 to show and hide the project navigator
  • ⌘ ⇧ Y to show and hide the debug console
  • ⌘ ⌥ 0 to show and hide the inspectors

6. Quickly open two files side by side

I already mentioned the Open quickly ⌘ ⇧ O command - which becomes even more powerful when using it with .

  1. Use ⌘ ⇧ O to open the dialog
  2. Enter the file name you are searching for
  3. Use in combination with enter to select the file. The new file will open in a separate editor allowing us to continue working on our current file while having access to the new opened file.

The tip also works when selecting a file in the project navigator.

7. Quickly jump to a specific method in a file

This shortcut comes in particularly handy for larger files with numerous methods, where scrolling quickly becomes tedious.

  1. Use ⌃ 6 to open the documents structure
  2. Start typing the methods name
  3. Use enter to jump to the method.

You can skip letters when typing, Xcode will do the work for you.

8. Repeat the last test

The ⌃ ⌘ ⌥ G shortcut is especially useful when writing tests to repeat the last test we were running.

9. Reindent code

We can re-indent selected code in Xcode by pressing ⌃ I - which is useful when code is out of place, for example after refactoring.

10. Disable / enable breakpoints

This ⌘ Y shortcut comes in handy when debugging code to toggle between enabling and disabling breakpoint.

Sponsorship logo

Preparing for a technical iOS job interview

Preparing for a technical iOS Job Interview with over 200 questions & answers. Covering Swift & Objective-C, SwiftUI & UIKit, Combine, HTTP Networking, iOS File System, Core Data, Concurrency with async/await, Security, Automated Testing, Machine Learning and more.

LEARN MORE