Swift Package Manager expose internal dependencies

Hello,

this might be a really basic question as I don’t have a lot of experience with Swift Package Manager yet.

I would like to know what I need to do in order specify that the frameworks my package depends on, will also be imported and exposed within the file where I import my package.

For example:
I have a framework called »UIComponents« which internally imports UIKit to build custom components.

Now in my app I import UIComponents and have its contents available. However there I can not reference things from UIKit. For that I would need to import UIKit separately.

So how can I import my framework and then also have access to UIKit?
Similarly to how UIKit also gives me access to stuff from Foundation.

Thanks!
Accepted Answer
There is no supported feature for this today. There is however @_exported import which re-exports a module from your own, you can see it in use here. However, as the underscore indicates, this isn't considered a supported feature.

Thank you! Is this somehow considered bad practice or just not something that to date has made it's way into SPM?
Swift Package Manager expose internal dependencies
 
 
Q