How to add a Swift Package Manager package dependency

Oscar de la Hera Gomez
A flower that represents Swift next to a Flower that represents Xcode. Below it sits the words "Add a Swift Package Manger 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

A screenshot showing you how to navigate to the Swift Package Manager 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

To add a new package press the + sign under the package dependencies.

Press '+' to add a new package.

Step Three: Add your Package

A screenshot showing you how to add TinyConstraints via the search bar. It shows you how to select it from the browser and how to alter what you pull from Github.

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

A screenshot showing you how to select and add package products to your project.

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.

Any Questions

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.

delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details