Xcode and swift package manager

I'm new to swift (but very experienced in other languages) and am trying to understand how to manage dependencies for an ios app. My understanding is that SPM was used more for backend swift but is now being pushed more for ios as well.

I wanted to add https://github.com/typelift/Swiftz to my project so in Xcode I did

File -> Swift Packages -> Add Package Dependency...

and added the github repo.

This appears to have worked fine but now I'm expecting to find a Package.swift manifest but can't find one anywhere in the project. Does this mean that Xcode is not in fact using the SPM and is storing them using some other mechanism?

This article I wrote describes what happens on disk when using Swift packages with Xcode.

The package dependencies of an Xcode project are downloaded to the derived data folder for that project in the SourcePackages folder.

2 Likes

There are two different ways Xcode will manage SwiftPM packages. If you open a folder already containing a Package.swift manifest, Xcode will add to that manifest. If you start a new project, Xcode will internalize the manifest within its project file.

1 Like