How to add local Swift Packages to an iOS project
Learn how to add local dependencies to your iOS project by using Swift Package Manager and Xcode
17 Apr 2021 · 2 min read
The Swift Package Manager not only allows adding remote libraries as Swift Packages, but also local Swift Packages.
This possibility is useful, for example, when splitting a project into multiple libraries without having to worry about versioning and being able to directly edit the code.
This tip is a quick start for adding local Swift Packages to an iOS project. For more in-depth concepts, check out this Guide on the Swift Package Manager for iOS.
Adding a local Swift Package to an iOS project
Basically, adding a local Swift Package requires two steps.
- Drag and drop the local package into the Xcode project or workspace.
- Add it to the Frameworks, Libraries, and Embedded Content section in app targets general pane.

After doing that, we can import our local packages into our Swift files as we would do with any other library.

Removing a local Swift Package
Removing a local Swift Package from the project works the same as removing any other file from the project.

Newsletter
Like to support my work?
Say hi
Related tags
Articles with related topics
Latest articles and tips