apptekstudios / ASCollectionView

A SwiftUI collection view with support for custom layouts, preloading, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide dynamic library type for multiple targets in an app

kkla320 opened this issue · comments

Describe the bug
If you have multiple targets in an app (application and extension for example) you cannot add the library in both. The following error message appears in Xcode:
Swift package product 'ASCollectionView' is linked as a static library by 'SmartCook' and 'SharedUI'. This will result in duplication of library code.

I am not an expert in SPM but it seems a dynamic target is the solution for this kind of error in combination with Xcode. See this entry at Apple Developer Forums

Maybe there is another solution I do not know about.

To Reproduce
Create an app with two targets (app and extension for example) an add ASCollectionView via SPM to the app. Add the library to the extension target as well. Try building the app and the error described above will appear.

Screenshots
If applicable, add screenshots to help explain your problem.

Xcode Version:

  • 11.4

Simulator, Device, Both?

  • Both

I created a PR #129 für the issue.

Thank you for your PR. I have merged it into the dev branch and it will be included in the next release :)