How to add a Swift Package Manager package dependency
A step by step tutorial on how to add a Swift Package Manager package to an iOS XCode project, through the example of TinyConstraints. Github open-source repository included.
Step One: Navigate to Package Dependencies
Select the App configuration option in the file inspector in our case its the part that has an App Logo from the file inspector with the title Starter Project. Then under Project select Starter Project and Package Dependencies.
Step Two: Add a new Package
Press '+' to add a new package.
Step Three: Add your Package
Add the package repository url to the search bar, then select it and press Add Package.
Alternatively, if you've added it before, you can search for it - as we have searched for Tiny Constraints.
In this section you can also configure to add the latest branch or up-to a latest version.
Step Four: Add Package Products
Once XCode has resolved the package, select your desired package products and press Add Package.
Looking for more XCode tutorials ?
Here's a range of resources that might interest you.
We are actively looking for feedback on how to improve this resource. Please send us a note to firstname.lastname@example.org with any thoughts or feedback you may have.