In the past, iOS had CocoaPods to handle packages for objective-c code. These days, CocoaPods works with Swift and there is also Carthage. CocoaPods and Carthage have some differences themselves and they are both 3rd party package managers.
The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
SPM was introduced in Swift 3.0 and has XCode integration.
Adding a dependency can be done through XCode and in Package.swift looks something like this:
dependencies: [.package(url: "https://github.com/Alamofire/Alamofire.git",.upToNextMajor(from: "5.2.0"))]