简体   繁体   English

如何在Xcode工作区中的不同项目之间访问属性?

[英]How access properties among different projects in Xcode workspace?

I have a workspace. 我有一个工作区。 I have 4 projects in that. 我有四个项目。 Like A, B, C and D. A has appdelegate and other. 像A,B,C和D。A具有appdelegate等。 rest of projects only have classes. 其余项目只有班级。 I want to use A class appdelegate object in rest of classes. 我想在其余的类中使用A类appdelegate对象。 So please assist me, How to do that? 所以请协助我,该怎么做?

这样,您需要链接文件

For visibility of files in another target Select file & select check box in the inspector area. 为了使文件在另一个目标中可见,请选择文件并在检查器区域中选中复选框。 Additionally you can use open keyword in swift which is more than publicly available. 另外,您可以快速使用open关键字,这比公开可用的关键字更多。

open class func thisIsGlobalyVisibleFunction() -> String {
        return "global"
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM