查看Swift代码的头文件的三种方法

怎么在Xcode中查看swift文件的头文件?
第一种方法:Using the Assistant editor button

  1. Select your Swift file in the project navigator.
  2. Click the Assistant editor button in the Xcode toolbar as shown in Figure 1.
    Figure 1 Viewing the ListItem file in the project navigator. The numbers in this figure correspond to the steps above.
图1

Xcode automatically shows the generated interface for your Swift code in its Assistant editor pane using the Counterparts mode as shown in Figure 2.

Figure 2 Viewing the interface of ListItem in the Assistant editor pane

图2

第二种方法Using the Navigate menu

  1. Select your Swift file in the project navigator.

  2. Choose Navigate > Jump to Generated Interface as shown in Figure 3 to view your code's interface.

Figure 3 Select Jump to Generated Interface to view the interface of ListItem. The numbers in this figure correspond to the steps above.

图3

Figure 4 Switch back to the Swift file associated with the ListItem interface

图5

第三种方法Using the Generated Interface feature

  1. Select your Swift file in the project navigator.

  2. Click the related items button in the editor's jump bar.

  3. Xcode displays a contextual menu. Choose Generated Interface as shown in Figure 5 to view your code's interface.

Figure 5 Select Generated Interface to view the interface of ListItem. The numbers in this figure correspond to the steps above.

6

Figure 6 Switch back to the Swift file associated with the ListItem interface

6
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。