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
This is a surprising Extremely sad, extremely ups...
Everyone should be familiar with Douyin, and Douy...
Now there is a profession called new media people...
[[189802]] Why use WebView? With the continuous d...
Hainan agarwood has always been the best among al...
Recently, many of my friends came to me worriedly...
My friend Lao Wang complained to me this morning,...
Does your day start like this: rushing out in the...
In the kitchen, we often encounter some mysteriou...
Recently, 43-year-old Huo Qigang participated in ...
On July 5, 2023, the Science Popularization China...
As you know, writing articles is my hobby in my s...
Author: Xue Qingxin, registered dietitian Reviewe...
Li Ming, who originally planned to buy a car in Ja...
I wonder if you all are seeing “Shocking!” “Amazi...