【问题标题】:Different cocoapods for app and Today extension应用程序和今日扩展的不同 cocoapods
【发布时间】:2015-03-22 20:20:02
【问题描述】:

我在我的 iOS 应用程序中使用了几个引用 sharedApplication 的 pod,因此无法为 Today 扩展程序编译。

问题是我真的需要AFNetworking,所以我希望能够告诉CocoaPods 在编译扩展时只包含AFNetworking。有没有办法做到这一点?我查看了文档,但不清楚。

【问题讨论】:

    标签: ios cocoapods ios-extensions


    【解决方案1】:

    为此,您只需在 Podfile 中指定多个 target 块。例如:

    # Normal app pods
    
    target :extension, :exclusive => true do
      link_with 'extension'
    
      # My extension pods
    end
    

    请注意,这里的“扩展”对应于 Xcode 中扩展目标的名称。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      相关资源
      最近更新 更多