> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondwords.io/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS SDK

The BeyondWords iOS SDK allows you to embed the BeyondWords player directly into your iOS applications.

The SDK uses a `WKWebView` to load the BeyondWords web player and provides a native Swift interface for interacting with the underlying JavaScript API. As a result, most player functionality and properties are shared across the iOS SDK and web player.

You can compare supported properties in the [player properties reference](/docs-and-guides/distribution/player/developer-guides/player-properties).

Before you begin, make sure you have created a project and generated some content.

## Installation

### Install via CocoaPods

```ruby theme={null}
target 'MyApp' do
  pod 'BeyondWordsPlayer'
end
```

### Install via XCFramework

Download the XCFramework attached to the latest GitHub release.

<Card title="Download XCFramework" icon="apple" href="https://github.com/beyondwords-io/player-ios/releases/" target="_blank">
  View the latest iOS SDK releases on GitHub.
</Card>

## Load content

### Add PlayerView to your view hierarchy

```swift theme={null}
let playerView = PlayerView()
playerViewParent.addSubview(playerView)
```

### Load content into the player

```swift theme={null}
playerView.load(PlayerSettings(
    projectId: YOUR_PROJECT_ID,
    contentId: YOUR_CONTENT_ID
))
```

Replace `YOUR_PROJECT_ID` with your numeric project ID and `YOUR_CONTENT_ID` with your content ID.

Once your app is running, the player will automatically load the specified content.

## Configuration

The preferred way to configure the player is by going to **Distribution → Player → Settings** in your project dashboard.

However, you can override properties at the app level:

```swift theme={null}
playerView.load(PlayerSettings(
    projectId: YOUR_PROJECT_ID,
    contentId: YOUR_CONTENT_ID,
    playerStyle: "large",
    callToAction: "Listen to this recipe",
    backgroundColor: "yellow"
))
```

### Update properties after loading

You can also update properties after the player has loaded:

```swift theme={null}
playerView.setPlayerStyle("large")
playerView.setBackgroundColor("yellow")
playerView.setPlaybackRate(1.5F)
```

## Lifecycle

Call `destroy()` on the `PlayerView` when you no longer need the player—for example when the view is removed from the hierarchy or the containing view controller is dismissed. This releases the underlying web view and player resources.

```swift theme={null}
playerView.destroy()
```

## Example app

Refer to the example app, which demonstrates core player functionality, including how to build a custom player UI.

<Card title="Example app" icon="mobile" href="https://github.com/beyondwords-io/player-ios/tree/main/Example" target="_blank">
  Explore the example application on GitHub.
</Card>

## GitHub repository

<Card title="iOS SDK repository" icon="apple" href="https://github.com/beyondwords-io/player-ios" target="_blank">
  View the source code, releases, and API documentation on GitHub.
</Card>
