If you want to do your work well, you must first sharpen your tools. For an iOS developer, this means mastering Xcode. Xcode is a software that is a bit difficult to learn, but the following tips may significantly improve your programming efficiency. 1. Quick Open The Open Quickly command is in the File menu of Xcode. Of course, it is more convenient to use the shortcut Command+Shift+O. This command can open a small pane for quickly searching and browsing files, classes, algorithms, and functions. This command saves me tons of time every day, and if you haven’t tried the quick open command yet, I highly recommend you give it a try. 2. Display the project navigator In a large project with many files and folders, the Reveal in Project Navigator command can save you a lot of time. This command displays the current file in the Project Navigator bar on the left side of the interface. The default shortcut is Command + Shift + J. 3. Assistant Editor You may already be familiar with the Assistant Editor. Many developers don't use it enough, but it's great to be able to display a copy of a file or work in the user interface and view controller at the same time. The Assistant Editor can be used in many ways, but I often use it to find out where a particular algorithm appears and how it is called. To see this, move the cursor into the body of an algorithm and select Callers from the top menu of the Assistant Editor. 4. Jump to method When working with classes or structures, I often need to quickly jump to a specific method in the class. This is very conveniently done by using the shortcut Control + 6 followed by the first few letters of the algorithm. 5. Browse the documentation No matter how experienced you are, documentation is always a developer’s best friend. You can quickly open Xcode’s documentation browser by holding down the Option key and clicking the symbol you’re interested in, where you can search for a specific class or method. Here I recommend the Dash document browser, which is faster and more powerful than the built-in document browser of Xcdoe. In order to achieve the same effect as above on Dash, you need to install an Xcode plug-in. 6. Scope Editing Multiple cursors are a great feature that every advanced editor should have. Xcode's code editor also has this feature, but it is hard to find and hard to use. In Xcode, this feature is called Edit All in Scope (default shortcut Ctrl+Command+E). Move the cursor to the symbol you want to edit. If the mouse pointer stays on the character for one or two seconds, a small inverted triangle will appear on the right side of the character. Click the triangle and select Edit All in Scope from the menu. You can also set a shortcut key for this command. (Modification method: Preferences -> Key Bindings -> Search for "Edit all in scope") Unfortunately, Xcode's implementation of multiple cursors is not as powerful as Atom or Sublime Text. As far as I know, Xcode's multiple cursors only work for symbols. 7. Who is the glutton? Do you work in a team? Have you ever needed or just wanted to know who wrote that horrible error line of code? Move the cursor to the line with the error, right-click and select Show Blame for Line from the menu. Oops, did you do that? |
<<: Sharing of research methods on plain text reading experience on mobile terminals
>>: WeChat payment practice version
The charging process of a smartphone is mainly com...
When we operate educational products, there is no...
At a press conference on the afternoon of the 12t...
"Mutton is fat, don't eat it" "...
Many foreign media have confirmed that Google int...
This article was reviewed by Zhao Wei, MD, associ...
Course Catalog: ├──00 Electronic version of the b...
YouTube is the world's largest original video...
There is a long-standing topic on the Internet: s...
Today I will teach you how to delete 4 English fo...
How to cold start a new short video account is a ...
Can antigen testing and nucleic acid testing repl...
The twenty-six letters of the alphabet have all b...
We should not only protect wildlife We should als...