Xcode Cheat Sheet – Most used shortcuts and tips

Uplift iOS Interview

The Guide is for YOU if
  • You are preparing for an iOS interview and want to improve your skills and knowledge and looking to level up your interview game and land your dream job.
  • You want to gain confidence and ease during iOS interviews by learning expert tips and curated strategies.
  • You want access to a comprehensive list of iOS interview QA to practice and prepare.

If you’re an iOS developer, it’s essential to have a thorough understanding of the tools you use on a daily basis. After all, you likely spend 40 or more hours a week working with them, so knowing small hacks that can help increase your productivity can make a big difference.

I wanted to share some of my most used shortcuts and tips to help you get the most out of it. Xcode is a powerful integrated development environment (IDE) used for creating applications for Apple’s various platforms. It’s packed with features and tools that can help streamline your workflow and improve your efficiency.

Subscribe to my Newsletter and get the high-quality printable version of the poster as a WELCOME GIFT.

Or consider to Buy It to support my work!

PDF, Image

Take a look at SwiftUI specific Xcode cheat sheet Xcode SwiftUI Efficiency Hack

Buy It

One of my favorite shortcuts is the “Build and Run” command, which is activated by pressing “Command + R”. This command will build your project and run it in the simulator or on a connected device, saving you time and effort. Another one is “Command + Shift + O” which allows you to quickly search for a file in your project, which is especially useful for larger projects with a lot of files.

Additionally, I also recommend taking advantage of Xcode’s built-in code snippets feature, which allows you to quickly insert commonly used code snippets into your project. This can save you a lot of time and reduce the chances of errors.

Memorizing Xcode shortcuts can take some time and practice, but there are a few strategies that can help

  1. Practice regularly: Use the shortcuts in your daily work to help solidify them in your memory. The more you use them, the more likely you are to remember them.
  2. Create a cheat sheet: Create a cheat sheet of the shortcuts you want to memorize and keep it nearby while you work. This way, you can refer to it when you need to use a shortcut you don’t remember. I printed this poster and hung it just opposite my workstation. I learned 70% of it within 5 months.
  3. Focus on learning the most frequently used shortcuts first: Learn the shortcuts you use most frequently first, as they will have the most immediate impact on your workflow. Then, you can move on to learning less frequently used shortcuts.

Ultimately, the key to memorizing Xcode shortcuts is consistent practice and repetition. The more you use them, the more natural they will become and the easier they will be to remember.

In this article, I have added my most used shortcuts and some tips by which you can get most out of XCode.

Important keysControl ⌃
Option ⌥
Shift ⇧
Command ⌘
Basic
Preferences ⌘,
Console ⇧⌘C
Quick Help ⌘?
Build, Run, Test
Build ⌘B
Run ⌘R
Stop ⌘.
Test ⌘U
Clean ⇧⌘K
Clear console ⌘K
Documentation
Documentation ⇧⌘0
Help for clicked symbol ⌥ Click
Documentation for clicked ⌥ Double click
Find
Find in file ⌘F
Find and replace in file F
Find in project ⇧⌘F
Find and replace in project ⌘F
Find next ⌘G
Find previous ⇧⌘G
Code Navigation
Go to line number ⌘L
End of line ⌘→
Beginning of line ⌘←
Top of file ⌘↑
Bottom of file ⌘↓
Next word ⌥ →
Previous word ⌥ ←
Next subword ⌃ →
Previous subword ⌃ ←
Code Editing
Next placeholder ⌃/
Previous placeholder ⇧ ⌃/
Comment selection ⌘/
Fold method/class ⌥ ⌘←
Unfold method/class ⌥ ⌘→
Edit all in scope ⌃⌘E
Show completions ⌃Space
Next completion ⌃.
Accept completion Tab
File Navigation
Go forward ⌃⌘→
Go back ⌃⌘←
Open quickly ⇧⌘O
Find the current file in project ⇧⌘J
Show related items ⌃ 1
Debugging
Next issue ⌘’
Previous issue ⌘”
Fix next issue ⌃⌘’
Fix previous issue ⌃⌘”
Add breakpoint ⌘\
Activate breakpoints ⌘Y
Keyboard short cut

Find your desired file faster

Finding a file folder in your folder hierarchy is very painful if the project is big. You can use the Open quickly ⇧⌘O to make your life easier. On the dialog you can write any related text of file name to find the file.

Find your file in project navigator

Once you find the file using Open quickly ⇧⌘O, you can find the current file in project navigator by ⇧⌘J. I am using these two option almost everyday.

Rename

To rename or edit the name of variable/method etc. in scope use ⌃⌘E.

Avoid spelling mistake

Xcode can help you to avoid smelling mistake as it understand camel case syntax. To activate spelling: Edit > Format > Spelling and Grammar > Check Spelling While Typing.

Select code block and extract new method

Double click on any “{” or “}” brace will select the code block inside {}.

Bonus tips: From multiple selected lines of code or entire selected code block, you can extract a new method/variable: Right click > Refactor > Extract to Method

Add method documentation

If you want to write a documentation in your public API you need to click the function name and use ⌥ ⌘ / to generate method documentation.

Indent your code

UseI to indent your selected code block.

Check spelling mistake in Xcode

Check spelling mistake in Xcode
Check spelling mistake in Xcode

Memberwise Initializer in Xcode

Memberwise initializer comes by default in Swift structs. It accepts values for all properties of the struct. However, this feature is missing for classes.
Memberwise initializer comes by default in Swift structs. It accepts values for all properties of the struct. This feature is missing for classes. But you can add boilerplate code in a few clicks.
Buy It
Xcode Cheat Sheet Poster
Buy It

Overall, Xcode is a powerful tool that can help you develop high-quality applications for Apple’s platforms. By mastering its shortcuts and tips, you can improve your efficiency and productivity, allowing you to focus on what really matters: creating great software.



✍️ Written by Ishtiak Ahmed

👉 Follow me on XLinkedIn



Get Ready to Shine: Mastering the iOS Interview




Enjoying the articles? Get the inside scoop by subscribing to my newsletter.

Get access to exclusive iOS development tips, tricks, and insights when you subscribe to my newsletter. You'll also receive links to new articles, app development ideas, and an interview preparation mini book.

If you know someone who would benefit from reading this article, please share it with them.