【问题标题】:Bundle Resources Access Swift捆绑资源访问 Swift
【发布时间】:2016-03-15 02:54:33
【问题描述】:

我正在创建一个快速框架,以便在其他应用程序中重用我的代码。

为了重用 xib 文件,我在框架中创建了一个捆绑资源:

.xcodeproj -> target -> + -> Os X -> Framework & Library -> Bundle

我将 xib 文件添加到我的新包中,但现在我无法在主应用程序中访问此包,我尝试使用:

let frameworkBundle = NSBundle(identifier:"PRODUCT_BUNDLE_IDENTIFIER")

有什么想法吗?谢谢

【问题讨论】:

    标签: ios swift frameworks bundle


    【解决方案1】:

    让 frameworkBundle = NSBundle(forClass: SomClassInABundle.self)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-05
      • 2023-03-03
      • 1970-01-01
      • 2016-04-01
      • 2015-11-24
      • 2021-05-08
      • 1970-01-01
      相关资源
      最近更新 更多