Reputation: 16482
I was watching a WWDC video and they have a Swift Package and Swift app in the same project. How do you create that in Xcode? If I create a new Swift Package, I'm not able to add another target in the project.
Upvotes: 0
Views: 604
Reputation: 4487
That was tricky, at first I thought It was created by adding a local swift package. Then I discovered the created structure does not look like your screen capture.
So after research I found it was actually a xcworkspace
that joined the swift Package and app together.
How to create it?
First you should create a normal swift package in Xcode with File
-> New
-> Packages
Then you are going to drag the xcodeproj
file of the MyApp to the top of Xcode's left panel. You will be asked if you want to create a xcworkspace? just check yes.
I have uploaded to code to github, take a look at this repo
Upvotes: 1