Adding a Swift Package Dependency in Xcode 13
Xcode 13 brought plenty of changes to us and one of them is the new Swift Package Collections. This changed where we add Swift packages to our projects from.
The old File -> Swift Packages -> Add Package Dependency...
is no longer there, and I had to spend a few minutes finding where to add it in the Xcode 13 beta 1. Hopefully this article pops up on your Google results and you don’t have to scratch you head like I did.
The Old Way
Like I mentioned, before Xcode 13 you would click on the File
menu, navigate to Swift Packages
submenu and click on Add Package Dependency...
and this would open up a pop up where you could add the Swift package you want to use.
This option no longer exist so how do you add packages in Xcode 13?
The New Way
With Xcode 13, you need to add packages through the new menu they introduced with the Swift Package Collections. To find this menu, you need to navigate to your project settings where you can find a new menu for Swift Packages.