Fast moving around in Xcode

Kent Winder
Nextzy
Published in
2 min readJun 8, 2017

For us, developers, we have to use IDE most of our working time, so if we use keyboard shortcuts instead of mouse clicks, it could save us a lot of time. I’m gonna list some of the hotkeys for Xcode that I use the most

Here are keyboard symbols using in this post (for those who are new to Mac)
⇧ = Shift
⌃ = Control
⌥ = Option/Alt
⌘ = Command

= Enter
⇡⇣⇠⇢ = Up/Down/Left/Right Arrow Keys

Moving between editors, show/hide area in Xcode

Moving between files

  • Open file in workspace: ⌘ + ⇧ + O then type your file name, then select from the filtered list
  • Find in workspace: ⌘ + ⇧ + F
  • Find and replace in workspace: ⌘ + ⇧ + ⌥ + F
  • Go to previous/next opened file: ⌘ + ⌃ + ⇠ OR ⇢, or swipe right/left on trackpad with two fingers
  • Switch between .m and .h files: ⌘ + ⌃ + ⇡ OR ⇣
  • Reveal current file in Project Navigator: ⌘ + ⇧ + J

Working with tab (similar to Safari)

  • Open a new tab: ⌘ + T
  • Close current tab: ⌘ + W
  • Go to previous/next tab: ⌘ + ⇧ + [ OR ]

Moving inside file

  • Go to definition of variable/type in current file: ⌃ + 6, then type in
  • Go to definition of variable/type at current cursor: ⌘ + ⌃ + J, or ⌘ + click on it
  • When you scroll up/down to read other block of code, and want to go back to where the current cursor is: ⌘ + ⇧ + L
  • Jump to line: ⌘ + L
  • Move cursor to previous/next word: ⌥ + ⇠ OR ⇢

Modify code

  • Edit all in scope: ⌃ + ⌘ + E
  • Delete word backward: ⌥ + ⌫
  • Delete word forward: fn + ⌥ + ⌫
  • Delete sub word (e.g: Word in subWord) backward: ⌃ + ⌫
  • Delete sub word forward: fn + ⌃ + ⌫

Building and running

  • Build: ⌘ + B
  • Clean: ⌘ + ⇧ + K
  • Clean the build folder: ⌘ + ⇧ + ⌥ + K
  • Run: ⌘ + R

Debugging

  • Step into: F7
  • Step over: F6
  • Add/remove breakpoint: ⌘ + \
  • Disable/enable all breakpoints: ⌘ + Y

More

For other hotkeys, you can go to Xcode > Preferences > Key Bindings and choose from the list, and modify them to your liking.

Happy coding ^^

--

--

Kent Winder
Nextzy
Editor for

Just a regular guy who loves coding, reading, and getting tattoos