Consume Swift Package for multiple targets and platforms in a project?

后端 未结 2 834
一整个雨季
一整个雨季 2020-12-29 02:34

I have a project with multiple targets, such as an iOS app, a watchOS app, and some frameworks. How can I assign the same Swift Package to all my targets? Xcode only let\'s

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 02:40

    I had the same problem, and I only found this two solutions:

    First, add the package to the first target:

    Then, the first option is going to the other target, General tab, and in Frameworks, Libraries and Embedded Content press +, select the package and press Add:

    The other option is going to build Phases and repeat a similar way in Link Binary With Libraries:

    At the moment, I only know this options, I hope in the future Apple could improve this with a multi-check, for example.

提交回复
热议问题