Framework

Swift Packages

Create reusable code, organize it in a lightweight way, and share it across Xcode projects and with other developers.

Overview

Swift packages are reusable components of Swift, Objective-C, Objective-C++, C, or C++ code that developers can use in their projects. Xcode supports creating and publishing Swift packages, as well as adding, removing, and managing package dependencies. The package management support in Xcode is built on top of the open source Swift Package Manager project.

Topics

Package Dependencies

Adding Package Dependencies to Your App

Integrate package dependencies to share code between projects, or leverage code written by other developers.

Building Apps that Use Swift Packages in Continuous Integration Workflows

Prepare apps to consume package dependencies within an existing continuous integration setup.

Local and Standalone Packages

Creating a Standalone Swift Package with Xcode

Bundle executable or shareable code into a standalone Swift package.

Organizing Your Code with Local Packages

Simplify maintenance, promote modularity, and encourage reuse by organizing your app’s code into local Swift packages.

Editing a Package Dependency as a Local Package

Override a package dependency and edit its content by adding a Swift package as a local package.

Developing a Swift Package in Tandem with an App

Add your published Swift package as a local package to your app’s project and develop the package and the app in tandem.

class Package

The configuration of a Swift package.

Publishing Packages

Publishing a Swift Package with Xcode

Publish your Swift package privately, or share it globally with other developers.