我已经阅读了通过苹果的文档Swift和没有找到任何关于如何创建模块或如何定义类或结构成员为私有或公共。
在语法中有对import语句的引用,但我可以找不到它做什么或如何使用它的信息。
有谁知道我在哪里可以找到这个?
最新的Xcode 6 beta更新(beta 4)带来访问控制swift
Swift Enables Access Control
Swift access control has three access levels:
- private entities can only be accessed from within the source file where they are defined.
- internal entities can be accessed anywhere within the target where they are defined.!
- public entities can be accessed from anywhere within the target and from any other context that imports the current target’s module.