博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Viewing the interface of your Swift code,查看Swift代码的头文件的三种方法
阅读量:6914 次
发布时间:2019-06-27

本文共 2178 字,大约阅读时间需要 7 分钟。

 
Technical Q&A QA1914

Viewing the interface of your Swift code

Q:  How do I view the interface of my Swift code in Xcode?

问: 怎么在Xcode中查看swift文件的头文件?

A: Xcode generates an interface file that includes all your source code's internal and public declarations when using the Assistant editor button, the Navigate menu, or the Generated Interface feature. 

 

第一种方法: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.

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

第二种方法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.

Note: To jump back to your original Swift code, choose Navigate > Jump to Original Source "<your_filename>.swift" as shown in Figure 4.

 

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

第三种方法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.

Note: To go back to your original Swift code, choose Original Source in the above contextual menu as shown in Figure 6.

 

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

 


Document Revision History

 

Date Notes
2016-03-23

New document that describes how to view the interface of your Swift code.

 

 

 
 
Feedback

转载地址:http://qencl.baihongyu.com/

你可能感兴趣的文章
前端人员必看周刊和公众号
查看>>
SSProgressHUD - 加载动画提示、文字和图片提示、进度加载提示、可自定义、方便的API调用...
查看>>
实现一个简化版的vue-router
查看>>
Flv封装格式
查看>>
Android RecyclerView实现头部悬浮吸顶效果
查看>>
Python网络爬虫(七) 深度爬虫CrawlSpider
查看>>
使用selenium抓取华尔街见闻和新浪财经数据
查看>>
ListView与EditText冲突问题解决
查看>>
接口咋整?前端数据药神来也
查看>>
使用Jenkins自动构建Android应用打包并上传
查看>>
Android 混淆简单入门
查看>>
视口相关单位的应用 —— 别说你懂CSS相对单位
查看>>
说说在 Vue.js 中如何绑定样式(class 或 style)
查看>>
如何优雅地在 Java 8 中处理异常
查看>>
Pandas分类数据详解 | 轻松玩转Pandas(5)
查看>>
由自定义事件到vue数据响应
查看>>
前端模块化:CommonJS,AMD,CMD,ES6
查看>>
React Native 性能优化组件-PureComponent
查看>>
CSS3系列-css3之线性渐变初探
查看>>
没错,这个就是那个面试可能会问的"破题"!
查看>>