Xcode Essential Shortcuts
2 min read

Xcode Essential Shortcuts

Xcode Essential Shortcuts

As an Android Developer i was familiar with most of the shortcut keys for Android Studio that made my life easy while coding. As I am currently progressing towards a new phase on my carries trying out IOS, the IDE Xcode gave me nightmares😅.

Slowy and steadly i was able to grasp some of the shortcut keys which i think would also be useful for someone switching from Android to IOS.

Nevertheless, it pays off to know your way around Xcode and be proficient in the core editing and navigation commands to increase your productivity. So lets start with the list.

Quick Open (⇧ + ⌘ + O)

This was the first shortcut i came through and it became one of my favourite and the most used one. This allows you to quickly jump to any source location in your project/ workspace.It can be used to search filename, methodname, classname etc.

Pro Tip: Just like in Android studio we can do fuzzy searching as well such as for a class named UserProfileViewController  UPVC would work.

Jump to Line( ⌘ + L)

When you want to navigate to a specfic line in the file. Just like the command + L  on Android Studio.

Highlight File in Project Navigator(⇧ + ⌘ + J)

This command comes in handly when you want to see the group where the file opened in the editor is present.

Switching Tabs (^ + ⇥)

When switching from one tab to another from left to right, adding a shift allows a right to left switch( ^+ ⇧ + ⇥)

Show / Hide Preview (⌥ + ⌘ + ↩)

This is swift ui specific but a nice one to toggle the preview view.

Build and Run All Test Cases (⌘ + U)

As the name suggests it is used for running all the Unit test cases.

Code Completion (⌃ + Space)

I use it to explore the API's available, a similar one on Android Studio is ⌘ + Space

Organiser (⌥ + ⌘ + [ and ⌥ + ⌘ + ])

This is also one of my favourites, we often require moving single line code or blocks to arrange the code properly, this shortcut really comes in handly instead of the copy/paste.This is similar to Command + Shift + Up/down arrows in Android Studio.

Comment Line/Block (⌘ + /)

Useful for temporarily disabling lines or blocks of code while testing. Android Studio has something similar as command + / for single line code and command + Alt + / for a block.

Indentation (⌃ + I)

Used to set the correct indentation, ⌘ + ⌥ + L being similar on Android Studio.


P.S- I am still in the process of learning and hopefully will find some more useful ones.