Seven Xcode tips every developer should know

Seven Xcode tips every developer should know

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

Recommend

Is Google's return to China a pipe dream or a comeback?

On October 20, American Internet giant Google ann...

How to do content marketing on Zhihu?

With the disappearance of the demographic dividen...

How to A/B test your app icon

[[145648]] In addition to the app name and previe...

Ramen’s Marketing Strategy

Whether it is an old brand that has quickly becom...

Why does the iPhone X have no chin? You'll understand after reading this

Recently, the vivo APEX has been making waves in ...

TensorFlow implements image completion based on deep learning

[[191845]] Table of contents ■ Introduction ■ Ste...

Galaxy Note4's four tricks

Samsung's new generation of giant screen flags...

Online traffic diversion skills for training institutions

When chatting with me, many heads of offline inst...

4 case studies: The fission model of “group buying”

The method of group buying is to use social relat...

9 major trends in short video content marketing in 2020

In 2019, all good things came at the right time. ...

The underlying logic of Douyin’s product selection

There is a popular saying in the Douyin e-commerc...

TikTok e-commerce and cross-border e-commerce development trends!

In February 2021, TikTok quietly launched TikTok ...