Logo for tanaschita.com

My favorite Xcode keyboard shortcuts to be more productive

Increase your productivity when working with Xcode.

updated on 15 Apr 2024 · 3 min read

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
Preparing for a technical iOS job interview - updated for iOS 17
Check out my book on preparing for a technical iOS job interview with over 200 questions & answers. Test your knowledge on iOS topics such as Swift, SwiftUI, Combine, HTTP Networking, Authentication, SwiftData & Core Data, Concurrency with async/await, Security, Automated Testing, Machine Learning and more.
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 - updated for iOS 17
Check out my book on preparing for a technical iOS job interview with over 200 questions & answers. Test your knowledge on iOS topics such as Swift, SwiftUI, Combine, HTTP Networking, Authentication, SwiftData & Core Data, Concurrency with async/await, Security, Automated Testing, Machine Learning and more.
LEARN MORE

Newsletter

Image of a reading marmot
Subscribe

Like to support my work?

Say hi

Related tags

Articles with related topics

xcode

quick tip

productivity

Quick tip on how to learn Xcode keyboard shortcuts efficiently

A workflow to memorize Xcode keyboard shortcuts.

08 Apr 2024 · 2 min read

Latest articles and tips

© 2024 tanaschita.com

Privacy policy

Impressum