Swift Package Manager with Multiplatform App

Viewed 194

So I am trying to publish my first Swift package. It should be available to iOS and macOS SwiftUI-based apps. This is the package I am trying publish: https://github.com/simibac/ConfettiSwiftUI

When I create a standalone iOS or macOS app I don't encounter any problems with the package. Everything works as expected. However, when I import the package into a Multiplatform app, I can build it on iOS but on macOS it does not work. I get an error when I try to import the package. I restarted xCode and it cannot be built. Any ideas how to fix this issue?

enter image description here

1 Answers

I found the problem. When adding the package to the project, it is only automatically added to the iOS target and not the macOS target.

Adding it manually resolves the issue.

enter image description here

Related