Reputation: 17774
My Swift library FlexColorPicker just adopted Swift Package Manager support. The library itself can be added to any project via XCode by doing File → Swift Packages → Add Package Dependency... → choose target → enter https://github.com/RastislavMirek/FlexColorPicker
→ confirm. However, there is a demo that comes with the library that cannot be run when installed this way.
I want to add another (probably executable) product FlexColorPickerDemo
to Package.swift
that users can chose to include (or exclude) and then run inside their project just to see what they can do with the library. Besides adding new product and target to the Package.swift
file I probably need to add main.swift
, right? How should it look so that it allows running the demo as iOS app when installed via SPM?
Any help appreciated, even tutorial link, I don't really know what to Google...
Upvotes: 9
Views: 1140
Reputation: 4546
You want a complete demo project to be 'included' in a Package.swift
file?
That's not possible, the same reason why bundled resources aren't useable (yet) by SwiftPM: How to include assets / resources in a Swift Package Manager library?
Best way imho would be to update your README file and explain how users can test the library, just like you're already doing.
Upvotes: 1