Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Install Swift SDK (Generated)

Guides Tooling SDKs Install Swift SDK (Generated)
Edit this page

Install Swift SDK (Generated)

You can use Box Swift SDK to call Box APIs in a Swift project.

Swift SDK is in a Public Beta phase.

Learn more about Swift SDK on GitHub

Swift Package Manager

Swift Package Manager is a tool for managing the distribution of Swift code. It is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To add a dependency to your Xcode project:

  1. Select File > Add Package Dependency in your Xcode project.
  2. Click the plus icon > Add Package Collection.
  3. Enter the following repository URL: https://github.com/box/box-swift-sdk-gen.git and click Load.

Alternatively you can add a dependency to the dependencies value of your Package.swift.

For detailed instructions, please see the official documentation for Swift Package Manager and XCode documentation.

Carthage

Carthage is a decentralized dependency manager which builds your dependencies and provides you with binary frameworks.

To add a dependency to BoxSdkGen:

  1. add the following line to your Cartfile :
git "https://github.com/box/box-swift-sdk-gen.git"
  1. Run:
carthage bootstrap --use-xcframeworks
  1. Drag the built xcframework from Carthage/Build into your project.

For more detailed instructions, please see the official documentation for Carthage.