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

后端 未结 2 840
一整个雨季
一整个雨季 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:51

    If you add a new target after you added the dependency, then you will have to remove the dependency from the project and then add it back in again. Otherwise the library will not show up in the framework chooser.

    It's annoying that the one reliable thing Xcode can do with Swift Package Manager is crash for me. So make sure you have a backup of the project because it can get to a state that just opening it will crash Xcode.

提交回复
热议问题