XcodeDevelopment tips andTipsIs the content to be introduced in this article, I always try to remember a varietyXcodeAs well as various prompts andTips. During programming, I always try to use the mouse as little as possible. Without these prompts, I will be at a loss. Here we record these prompts andTipsThe best place. This is the first article. I hope there will be moreXcodeAndTipsArticle.
Vertical Split editor View
If you prefer to use multiple code windows at the same time, the editor split option can help you pay attention to small and medium-sized square grid icons ).
By default, windows are horizontally split. If you want to observe your code in parallel for comparison), the following describes how to vertically split the window:
Press the Option key when you split the window icon.
Uncomment a piece of code
You can add annotations for a piece of code as follows:
Select one or more lines of code to be annotated
Press Command -/
To remove the annotation of a piece of code, repeat the above steps.
Switch between. h and. m Files
In the current code window, use the following method to quickly switch between. h and. m:
- Command-Option Up-Arrow
Key and action ing Key Binding)
The above prompt can indeed save a lot of time. However, I found that I prefer to map actions to buttons as usual. For example, I can map the action in the previous prompt to Option-S, just like most switching and switching actions.
The following describes how to bind a key in Xcode:
1. Select Prefereces preference from the Xcode menu)
2. select Key Bindings to bind)
3. Click an Actions action in the list)
4. Tap the Keys column on the right
5. Enter the buttons you want to map to this action
6. Press OK to save your changes.
Open API documentation
Show APIs in any related SDKDocumentVery simple:
Double-click the Option key in the relevant code.
For example, in the screenshot below, after double-clicking UIToolbar, a pop-up window will display the summary of this class.
Tip #6-history of Objects
When you open and edit files, Xcode keeps a list of actions as it uses a web browser. You can move the arrow keys in the list as follows:
The equivalent key is as follows:
- Option-Command Left-Arrow move to the previous file
- Option-Command Right-Arrow move to the next file
Bookmarks
I can't imagine there is no way to do it during programming.BookmarksSet what will happen. When I want to continue to find a piece of code in another file, I often need to set bookmarks. Bookmarks are simple:
- Control-D
Enter the bookmarks
Jump to bookmarks
There are two ways to jump to bookmarks. First, you can select the bookmarks icon in the upper-right corner of the editor window.
You can use the following key to obtain the same menu:
- Control-4
Indent/unindent
You can indent a line or segment of selected Code as follows:
- Command-[move code to the left
- Command-] Move code to the right
The above method works no matter where you are in the code line. In other words, you do not have to be at the beginning of a line.
Zoom Editor
You can switch between the Detail View and Editor view by pressing the Editor button as shown in.
Equivalent to the above, the key is:
- Shift-Command-E
Summary: DetailsXcodeDevelopment tips andTipsI hope this article will help you!