u/EricaTD

How to distribute my library?

Hello everyone, I've been developing a library + a small demo app for a few months and seem to have hit a wall.

Initially, the library and demo shared a repo. However, I now want to split them so I can test the actual library usage (how to add it to the project, is it easy enough to understand, etc). The split was no issue, but I can't seem to export the ios specific code.

I have an architecture package (my library) whose framework is correctly exported as a XCFramework. My iosApp package has no trouble accessing the architecture/iosMain classes. In iosApp, I have a factory for a viewcontroller that's needed in my architecture library. So I need to export the iosApp to SPM so I can use the factory in my app.

Problem is, when the iosApp package is imported into my app, it all breaks. Is there really no documentation on how to cleanly export the iosApp module as a dependency?

reddit.com
u/EricaTD — 2 days ago