Find a package
You can find a small selection of curated packages on Swift.org’s Packages page (opens in new tab).
For a more complete library, the Swift Package Index (opens in new tab) hosts a large number of packages for you to explore.
Add a package
In Xcode, go to File → Add Package Dependencies...
In the search field in the upper right, enter your package URL. This is usually a GitHub repository URL, like https://github.com/apple/swift-markdown.

Select your package.
Select a Dependency Rule. In most cases, you probably want to set this to Up to Next Major Version.
Click Add Package.
Under Add to Target, select the target you want to add the package to.

Click Add Package.
Done! Yes, it’s that simple.
Add to multiple targets
Select the additional target you want to add your package to in the Project Editor.
In the General tab, scroll down to Frameworks and Libraries and click the + (plus) below the list.

Select your package in the list, and click Add.

Update packages
Single package
Under Package Dependencies in the Project Navigator, control-click (right-click) the package and select Update Package.

All packages
Control-click (right-click) Package Dependencies in the Project Navigator and select Update to Latest Package Versions.

Remove packages
Single target
Select the target you want to remove your package from in the Project Editor.
In the General tab, scroll down to Frameworks and Libraries and click the − (minus) below the list.

Confirm by clicking Delete.

Project (all targets)
Select your project in the Project Editor.
In the Package Dependencies tab, select the package you want to remove and click the − (minus) below the list.

Confirm by clicking Remove.
