Xcode shortcuts that make developer’s life easier

Osman Tüfekçi
3 min readJan 20, 2022

--

A developer spends a lot of time during code writing, jumping between tabs that contain class files, tons of variables, thousands of lines and it could be overwhelming. Luckily, Xcode is a wonderful IDE for Swift developers who love shortcuts and I am one of them. I’m going to show you most useful shortcuts that I use during code writing.

Cmd + Shift + O

Cmd + Shift + O

For example you want to open a file that contains specific class and you don’t remember name of the file. Hit Cmd + Shift + O keys and you’ll see a search bar appears in the middle of the screen.

You forgot the class name ? No problem, you can even search for variable name, when you find it just select from the list and ta da! You have just found what you are looking for.

Cmd + Shift + J

This shortcut is just the opposite of previous one. File is in front of you but you want to find in the file hierarcy ? Just hit Cmd + Shift + J, Xcode will automatically select the corresponding file.

Cmd + R, Cmd + .

Not need to say much, in order to build your project you can just hit Cmd + R instead of click on a button. Want to stop it ? hit Cmd + .

Cmd + Alt + Shift + <- (left arrow or right arrow key)

If you work on large file/class there will be numerous of functions, delegates, closures etc. In this case you can fold unnecessary closures and create more free area for yourself. Want to unfold ? Just hit Cmd + Alt + Shift - Right arrow key

Cmd + Left/Right Arrow keys

With this combination you can move your cursor first/last of the line. Don’t bother taking your hand off the keyboard and holding the mouse

Cmd + Shift + Left/Right Arrow Keys

Very much similar to previous shortcut, but with this, you can select whole line of code from your cursor position to first/last line of the code.

Alt + Left/Right Arrow Keys

Stop moving your mouse over in order to select specific area in one line of code. Use this shortcut. It makes your cursor jump over word by word

Alt + Shift + Left/Right Arrow Keys

Very much alike with Cmd + Shift + Left/Right Arrow Keys but there is a little difference from it, this one selects word by word as much as you hit those keys.

Ctrl + Shift + Up/Down arrow keys

Here it comes my favorite shortcut! In this scenario you have to write too much variables and their names very much similar. What would you do ? type first one then copy and paste ? If you are doing this hold on and look at this example, It shows last five shortcut at once.

Bonus: camelJump

Alt + Left/Right Arrow Keys

I don’t use this shortcut too much but sometimes it could be time saver. I call that camelJump because it selects from your cursor position to next uppercase character. Here is an example

Thank you for reading, I hope these shortcuts will help you a lot! I wish you all a bug free code.

--

--