
Effective work in any IDE, and not only in the IDE, is determined to a large extent by how much you use keyboard shortcuts and all sorts of features designed to make your life easier.
In this post I will try to share what I know and use myself, what has accumulated on the network, but I also count on your help. Share your finds and tricks. According to the results, I think to make some kind of PDF, like the famous Xcode-pdf pdf with shortcuts from
Colin Wheeler (donβt you know? Then thereβs a
link )
As for keyboard shortcuts, it is worth viewing the specified PDF. There are a lot of shortcuts, but there are some that I use more often than others.
Define symbols to describe shortcuts:
β - Control
β - Command
β₯ - Alt
β§ - Shift
β - Enter / Return
β - Escape
β β β β - Cursor
ββ β - Switch between header file and implementation. Probably the most frequently used combination.
βT - Opening a new tab (tab). By the way, if you click on the tab heading, you can give it a name, for example Debug.
CT - Open new window
β§β] - ββgo to next tab
β§β [- go to previous tab
βW - close the current tab, or window, if the tab is the only
βN - create a new file
βS - save current file
β₯βS - save all changes in all open files
')
When typing:
If you need to remove what autocomplete offers, then just press β Esc
and β₯β - if you want to see code completion.
βF - search in current file
β§βF - search for the entire project
βG - go to next search result
β§βG - go to previous search result
β + 1..7 - switch between navigators.
β / - comment out / uncomment the current line or a selected block, uncommenting works correctly only if the comment character is at the beginning of the line.
β] - shift the line / highlighted block to the right
β [- move the line / selected block to the left
βR - run the program
βI - run the program with tools (allocations, leaks etc.)
ββ₯β0 - show / hide utility panel (right panel)
ββ₯β1..4 - switching between libraries of templates, snippets, objects and media data
Some more shortcuts from
arturphoenixβ§βO - fast opening of a file or transition within a file.
βL - go to line with number
ββE (when setting the cursor to a variable) - quick renaming of a variable in the current scope.
I would like to dwell separately on snippets.
In addition to existing snippets (code snippets), you can create and edit your own ones.
Create a snippet for the #pragma mark
Open the snippets library by pressing ββ₯β2 if it is not open.
First, select the necessary fragment in the code:

Next, with the mouse drag the selection into the window of the snippet, the editing window opens. Set the name:

Shorkat:

the scope (visibility) of the snippet (in our case, all) and the placeholder into which custom text will be inserted. Placeholder is set in this format - <# placeholder #>:

Click Done and see what we did. In the code, we start to type mark:

We get a hint of auto-population, click and it remains only to enter the text of the marking:

Very handy thing. I added a lot of things to myself.
Waiting for your comments, shortcuts and tricks to improve the performance in Xcode!