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.

 

 

 


Copyright © 2016 Apple Inc. All Rights Reserved. Terms of Use |  Privacy Policy | Updated: 2016-03-23

 
 
Feedback
 

 

*

 

*

 

 

 

Viewing the interface of your Swift code,查看Swift代码的头文件的三种方法的更多相关文章

  1. C#中??和?分别是什么意思? 在ASP.NET开发中一些单词的标准缩写 C#SESSION丢失问题的解决办法 在C#中INTERFACE与ABSTRACT CLASS的区别 SQL命令语句小技巧 JQUERY判断CHECKBOX是否选中三种方法 JS中!=、==、!==、===的用法和区别 在对象比较中,对象相等和对象一致分别指的是什么?

    C#中??和?分别是什么意思? 在C#中??和?分别是什么意思? 1. 可空类型修饰符(?):引用类型可以使用空引用表示一个不存在的值,而值类型通常不能表示为空.例如:string str=null; ...

  2. 三种方法查看MySQL数据库的版本

    1.使用-V参数 首先我们想到的肯定就是查看版本号的参数命令,参数为-V(大写字母)或者--version 使用方法: D:\xampp\mysql\bin>mysql -V 或者 D:\xam ...

  3. Linux下查看alert日志文件的两种方法

    --linux下查看alert日志文件的两种方法: --方法1: SQL> show parameter background_dump_dest; NAME TYPE VALUE ------ ...

  4. 【MySQL】锁——查看当前数据库锁请求的三种方法 20

    MySQL提供了查看当前数据库锁请求的三种方法:1. show  full  processlist命令  观察state和info列 2. show engine  innodb status\G ...

  5. Linux下查看磁盘挂载的三种方法

    Linux下查看磁盘挂载的三种方法 2009-06-05 23:17 好久没有更新日志了,呵呵.不是没有要写的东东.实在抽不出时间来写,要准备公司的考试呢,C++考试.已经有七个月没有写C++代码了, ...

  6. linux查看磁盘挂载的三种方法

    第一种方法:使用df命令,例如: orientalson:/home # df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda ...

  7. 使用Idea当中的快捷键快速查看继承关系或其图表的两种方法

    一.Idea当中有两种方法可以查看继承关系 在Idea当中选中一个类,然后按Ctrl+H,可以快速查看当前所选类的继承关系,如下图: ​ 同样选中一个类,按CTRL+ALT+U,即可生成当前类的继承关 ...

  8. Docker MySql 查看版本的三种方法

    目录 Docker MySql 查看版本的三种方法 1.mysql -V命令查看版本 2.status命令查看版本 3.version命令查看版本 Docker MySql 查看版本的三种方法 1.m ...

  9. Linux下用于查看系统当前登录用户信息的4种方法

    1. 使用w命令查看登录用户正在使用的进程信息 w命令用于显示已经登录系统的用户的名称,以及他们正在做的事.该命令所使用的信息来源于/var/run/utmp文件.w命令输出的信息包括: 用户名称 用 ...

随机推荐

  1. django-访问控制

    django自带的用户认证系统提供了访问控制的的功能.   1.只允许登录的用户登录   django的用户可分为两类,一是可认证的用户,也就是在django.contrib.auth.models. ...

  2. for循环的灵活性

      for循环把初始化.测试和更新组合在一起,其基本形式如下所示: for(初始化:测试条件:更新表达式) { //循环体 }   关键字for后面的圆括号中3个表达式,分别用两个分号隔开:   第一 ...

  3. UML类图的几个名词及对应符号

    实现(Implements) 实现的符号为:\(--- \triangleright\) 箭头指向接口. 泛化/继承(Inheritance) 继承的符号为:$ -\triangleright $ 箭 ...

  4. 使用 IntraWeb (31) - IntraWeb 的 Xml 操作使用的是 NativeXml

    在 IWNativeXml 单元. 知道了这个, 以后在其他 Delphi 程序中也可以直接 Uses IWNativeXml 了. TNativeXml (IWNativeXml.TNativeXm ...

  5. c#代码混淆

    1.C#编写的dll库如何加密 2..NET Reactor使用教程 3..NET Reactor中各种混淆含义.原理 4..NET Reactor制作软件许可证 5..NET Reactor混淆代码 ...

  6. android: 在android studio中使用retrolambda的步骤

    找了各种说明,包括retrolambda官方文档都没有试成功 最后在这个链接中找到答案:http://blog.csdn.net/qq_26819733/article/details/5222565 ...

  7. 异常 try catch finally return 执行关系 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  8. (转)Fur Shader

    转自:http://qiankanglai.me/misc/2014/11/15/fur-shader/ 花时间看了下毛发效果,苦于囊中羞涩没能买QuickFur.furFX等插件,最后找到了Fur ...

  9. 这些年我在技术路上做过最虚伪愚蠢的事情,就是在CSDN上刷屏赚分

    现在似乎Github成了所谓技术人士的新宠,之前是博客,更早则是论坛. CSDN是众多技术论坛里比较突出的一个,人多高手也多,很多问题都能得到满意的回答. 谁都希望自己卓尔不群,我也不例外,我也想像那 ...

  10. PL/SQL学习笔记之基本块格式与语法

    一:PL/SQL程序块 PL/SQL是一种块结构的语言,一个PL/SQL程序就是一个 代码逻辑块. PL/SQL程序由三部分构成: 1 声明 部分 使用关键字DECLARE开头,它是一个可选的部分,用 ...