How to add a local Swift Package in XCode

Oscar de la Hera Gomez
Two flowers that represent Swift and Xcode with the text "Swift Package Manager Add Local Package" beneath it.

A step by step guide on adding a local Swift Package through the Swift Package Manager in XCode.

The following tutorial is based off the process that we carried out as part of our GraphQL Swift tutorial which uses a Local Package to allow you to make GraphQL API calls.

Step One: Add a New Package

A screenshot of Xcode highlighting how you can access the Package Dependencies of a project. We have also highlighted the + button that allows you to add a new package.

Navigate to the Package Dependencies of your project and click +.

Step Two: Add Local Package

A screenshot of Xcode showing the Swift Package Manager modal. We have highlighted the "Add Local.." button that appears at the bottom of the modal.

In the modal that appears, select Add Local...

Step Three: Select Local Folder

A screenshot showing the finder window that appears allowing you to select and add a local package. We have highlighted the PokeAPI folder that was generated in Step Eleven.

In the modal that appears, navigate to the location of the folder of the local package.

Select it and click Add Package.

Step Four: Confirm

A screenshot of the confirmation modal that appears when you add a local package. Click add package on the bottom right to finish this step.

In the confirmation modal that appears, click Add Package.

The local package will now be added to the projects package dependencies.

A screenshot of Xcode showing how the PokeAPI now appears as a package dependency in the project.

Looking to learn more about things you can do with Swift or XCode ?

Search our blog to find educational content on learning how to use Swift or XCode.

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