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
"I know there is a problem with my account, ...
With the rapid popularization of mobile terminals...
In modern society, contact lenses have become a d...
1. Structure and Architecture 1.1 Structure There...
The haze in winter is severe. In addition to seeki...
It is understood that the Alipay mini program wil...
Brand promotion can greatly increase exposure by ...
On February 16, Apple pushed the iOS/iPadOS 15.4 ...
At this year's 315 Gala, CCTV exposed an inci...
It has been more than 5 years since the release of...
What does a mini program mean to users? "Som...
Recently, the new generation of BMW X2 was unveil...
Expert of this article: Zhao Wei, Doctor of Medic...
The Chinese names of plants are like refined code...