Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 Swift 文件彼此可见,为什么我在 Appelegate 中的导入对于我的一个控制器不可见?我在那里得到一个错误。
这称为 Swift 模块的访问级别。Swift 模块的默认访问级别是内部的,即该文件本身。
在 Apple 文档中查看 Swift 模块中的访问级别
您需要在您使用的任何类中导入框架/模块。
放在import MessageUI你声明你的类的文件的顶部PBOUserViewController(我希望它包含在一个单独的 .swift 文件中,而不是你的 AppDelegate)。
import MessageUI
PBOUserViewController