Our Favorite Xcode Shortcuts
1. Edit all in scope: CTRL+⌘+E
This shortcut allows you to change the name of a variable or function and have that change take effect in your entire file. Here is an illustration:
Before
After
We simply clicked on `label` within the `set` method, typed ⌘+CTRL+E, and changed the name to `titleLabel`.
2. Fix all in scope: CTRL+⌥+⌘+F
This one is a handful, but it’s super handy. It will allow Xcode to automatically fix all errors that can be fixed automatically.
3. Open quickly: ⇧+⌘+O
Type ⇧+⌘+o and start typing in the search box that opens. The strength of “open quickly” is that the search engine is able to discern which files or functions you’re looking for even if you only enter parts of the name. For example, typing “appfinish” will bring up “applicationDidFinishLaunching” as part of the results.
4. Searching within a file: CTRL+6
This powerful shortcut opens the jump bar so you can see all existing symbols in the open file and search for the symbol you are looking for. Let’s look at an example of how it works.
Here is the jump bar:
Type CTRL+6:
Here’s where you type the name of the symbol you are looking for:
To make this shortcut more powerful, use CTRL+1–6 to open any part of the navigation hierarchy and start searching through it.
5. Jumping to a symbol definition
There are two ways to jump to a symbol definition:
- ⌘+Click on the symbol to jump to its definition in your current editor window.
- ⌘+⌥+Click on the symbol to open the symbol definition file in the assistant editor.
Below is the result of ⌘+⌥+Click on the `super.viewDidLoad()` symbol in our main editor. It opened the assistant with the `super` class definition of `viewDidLoad()`.
6. Open in…
Use ⌥+⇧ with any file or symbol action to bring up an “Open in…” UI and choose where to open this file or symbol.
For example, performing ⌘+CLICK+⌥+⇧ on a symbol will bring up the following UI:
7. Switching assistant editor
Since we just saw how to open a symbol in the assistant editor, here are three shortcuts to rapidly switch the editor:
- ⌘ + Enter opens the standard editor (single window).
- ⌘ + ⌥ + ENTER opens the assistant editor.
- ⌘ + ⌥ + ⇧ + ENTER opens the source control editor.
8. ⌘+⇧+J
In a typical project hierarchy it can be easy to lose track of where you are in your file tree structure. ⌘+⇧+J will help you by highlighting the file you are currently editing.
9. ⌘+0
Use ⌘+0 to toggle the navigator visibility and ⌘+1–8 to switch to any of the navigator tabs.
10. ⌘+⌥+0
The utilities area can be easily hidden or shown using ⌘+⌥+0. Add ⌘+⌥+1–3 to open one of the utilities tabs.
11. ⌘+⇧+⌥+K
If you are working with Swift and indexing or Source Kit is causing you grief a fast way to nuke your index and target resources is to use ⌘+⇧+⌥+K. This is the last step before removing your derived data folder.
Reference : https://medium.com/bpxl-craft/our-favorite-xcode-shortcuts-d3271c481d56#.4wbhx8gvy
Submit your website or blog now for inclusion in Google and 300+ search engines!
ReplyDeleteOver 200,000 sites listed!
Submit TODAY with I NEED HITS!