Tips and skills for Xcode Development

Source: Internet
Author: User

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:

 
 
  1. 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:

 
 
  1. Option-Command Left-Arrow move to the previous file
  2. 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:

 
 
  1. 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:

 
 
  1. Control-4 

Indent/unindent

You can indent a line or segment of selected Code as follows:

 
 
  1. Command-[move code to the left
  2. 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:

 
 
  1. Shift-Command-E 

Summary: DetailsXcodeDevelopment tips andTipsI hope this article will help you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.