This guide walks you through adding the Virtual Stadium iOS SDK to your project. The SDK is distributed through Swift Package Manager and includes both the Data SDK and UI SDK as integrated dependencies.
The Virtual Stadium SDK is hosted on GitHub and can be added to your project using Swift Package Manager (SPM). The UI SDK automatically includes the Data SDK as a dependency.
You can add the Virtual Stadium SDK to your project in two ways:
https://github.com/sportradar/VirtualStadium-SDK-UIVirtualStadiumUISDK product to add to your targetIf you're developing a Swift package, add the dependency to your Package.swift:
Package.swift:
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "YourApp",
dependencies: [
// Virtual Stadium UI SDK
.package(
url: "https://github.com/sportradar/VirtualStadium-SDK-UI",
from: "1.0.0" // Replace with latest version
)
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "VirtualStadiumUISDK", package: "VirtualStadium-SDK-UI")
]
)
]
)Replace "1.0.0" with the latest version from the releases page, or use .upToNextMajor(from: "1.0.0") for automatic minor and patch updates.
After adding the package, import the SDK in your Swift files:
import VirtualStadiumUISDKThe Virtual Stadium iOS SDK has the following minimum requirements:
| Requirement | Version |
|---|---|
| iOS | 14.0 or higher |
| Swift | 5.9 or higher |
| SwiftUI | iOS 14.0+ (native support) |
Ensure your project meets these requirements: Project Settings:
// In Xcode, verify:
// 1. General → Deployment Info → iOS Deployment Target: 14.0 or higher
// 2. Build Settings → Swift Language Version: Swift 5 or higherFor projects using Package.swift, ensure your platform requirement is set:
Package.swift:
let package = Package(
name: "YourApp",
platforms: [
.iOS(.v14) // iOS 14.0 minimum
],
// ...
)Now that you've added the SDK dependencies, proceed to the Usage Guide to learn how to initialize and configure the Virtual Stadium SDK in your app.