Dependency package management has been around for a while now in software development – the ability to add a dependent framework or snippet to your code base without the need for any major integration has often been seen as a benefit to many.
Managers such as NuGet and NPM are widely used and maintained by the community. Specifically for iOS development, CocoaPods and Carthage have been the big players; that was until the introduction of the Swift Package Manager or SPM for short.
Although it's been around much longer than you might think, it was recently announced at WWDC 2019 that Xcode 11 would have full integration support for the Swift Package Manager.
In this recipe, we are going to learn how to add a dependency to our project using the Swift Package Manager.
Getting started
For this project, we'll continue using our recent Xcode project where we implemented Fluent and Postgres – you can follow along in the sample recipe from GitHub...