iOS Development-Xcode common shortcut keys

Source: Internet
Author: User


The following are the first things you should learn about all the shortcuts in Xcode 6. After you learn how to use it, you may never be without it.

Xcode navigation shortcut keys

1. Engineering Navigator: command+1

Quickly browse through code, pictures, and user interface files.


2. Show/Hide Navigator Panel: command+0

When you're on the screen you might want to hide irrelevant parts of the content you're interested in. This shortcut is useful if you want to use an auxiliary editor or if you want to design a user interface and connect it to your code.


3. Show/Hide Utility panel: command+option+0

The utility panel is used primarily for editing user interface files, and you can hide it when you only consider writing code.


4. Open the file in the Auxiliary editor: Select the file in the Project Navigator to perform the option+ left click operation.

A quick way to open the Assistant editor-just hold down the option key and click on the file you want to open to the right of the current edit box.


Xcode Search Shortcut keys

When you hit the code, suddenly want to add a function, or want to change what bug, of course, the quickest way is to use a search. Instead of scrolling through hundreds of lines of code, you can simply jump to a specific piece of code by using a lookup.

5. Search Navigator (find Navigator, i.e. search): command+shift+f

Use the project search to find the number of times a variable or method name has been mentioned. Can be matched against an instance, and the uppercase and lowercase letters can be ignored. You can also replace the name of the variable you are looking for.


6. File Jump bar: Control+6 (type method/variable name +enter jump)

Jumps to the line of code in the current code file. If you have thousands of lines of code in your file, you can use this shortcut to narrow your search to insert code where needed to add new functionality.


7. Quick open: Command + Shift + O

People who like to use the keyboard but do not like to use the mouse will love this shortcut, can jump directly to a method definition or the specified code file.


8. Jump bar and quick Open Search input shortcut keys

You can quickly switch to a file or find a specific line of code by typing the first letter. For example, in the Viewcontroller.swift file, press COMMAND + Shift + O, and then type VDL, and the first results are shown with

The function of the viewdidload () name.

Type the initial letter to search for more with less input.


9. In the program (written in objective-c or C + +). Fast switching between H and. m files: Control + Command + up Arrow

If you write programs in Objective-c and C + +, or use open source code written in other languages, you may need to look for existing code. You can use the control + Command + UP ARROW key combination to quickly switch between two related files, such as header files and implementation files in Objective-c. If you use Swift to write code, this is a bit inappropriate, because Swift uses a single code file.

Application compilation and cleanup

You have to run it before you can experience a new app, but sometimes Xcode doesn't work well to run your project, and you'll need to clear the items you can't run.

The following shortcuts help you to use the mouse as little as possible during code writing.

10. Run App:command + R

In the process of writing code, I usually use the shortcut from running the application. Test the application as much as possible so that you can find and fix bugs in your app early.


11. Clear Project: Command + Shift + K

Maybe there was a problem with Xcode running, or the app couldn't respond, or something unexpected happened, you'd first want to clean up the project and run it again. If that doesn't solve the problem, all right, turn off Xcode.

and re-open. If the application does not work, see if there are any error message prompts, you can play as the "Googler" advantage to get help. However, this practice is not easy too often, it will slow down the development of the program. It will remove all intermediate files, and it takes time to recreate the files.

Clear Xcode project when run fails


12. Build the application: Command + B

Checking the code to make sure it works is something you often have to do, and compiling an app project lets you determine whether it works before you write the next feature. Even if Xcode is checked quickly after the code has been written, it is delayed, or some inappropriate error hints are given. You don't have to run the application all the time, and if you just make some small changes, the build will help you do a quick check so you can return to the next line of code.

Compiling code to ensure that the application does not have any error issues


Documentation and help

Self-learning is important in learning, and for developers who have not browsed the Xcode documentation help, these shortcuts can help you look at the relevant code references to better understand the code provided by Apple to develop a more robust app.

13. Documentation and references: Command + Shift + 0 (Zero)

Use Xcode to install documents in the background and support offline search, ideal for working out. Open the document and reference, and type a keyword in the code, and the Xcode document also provides some additional resources and sample engineering.

Learn how to use code with the Documentation and reference guide


14. Quick Help: Perform the OPTION + Left-click operation on the class or method name

Inline help can help developers quickly learn how to use a class or code snippet. Perform the OPTION + left-click operation on a variable, class, or method name to get more detail information. If you click on the reference link at the bottom of the pop-up view, you can easily jump to the documentation provided by Xcode. You can also perform a option+ double-click name operation on a variable, class, or method name to make it easier to jump to the document.

Get quick help writing code

Other shortcut keys:

"Recently preferred command + Shift + J quick action to show the files you currently open in the Project navigator. I recently spent a lot of time on a large code base that can quickly jump in the code base "

-weendex

"I love Ctrl + 1, this shortcut will open the ' Show related Items ' pop-up menu. If you have placed your cursor in any method and clicked ' CTRL + 1 ', you can easily access all callers and callers of the method through the popup view. I often browse the caller of the method to understand how to use the method. "-skoll

"CMD +. Conveniently pauses the iOS emulator "-weendex

I often use a shortcut that is not mentioned in this article to perform the ' Command + Option + Shift + left-click ' operation on a file, which shows a small-size pop-up view where you can see where you want to open it, such as an auxiliary editor, a label, or a window. "-cheezybob

iOS Development-Xcode common shortcut keys

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.