Skip to main content
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. Before you begin, make sure you have created a project and generated some content.

Installation

Install via CocoaPods

target 'MyApp' do
  pod 'BeyondWordsPlayer'
end

Install via XCFramework

Download the XCFramework attached to the latest GitHub release.

Download XCFramework

View the latest iOS SDK releases on GitHub.

Load content

Add PlayerView to your view hierarchy

let playerView = PlayerView()
playerViewParent.addSubview(playerView)

Load content into the player

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:
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:
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.
playerView.destroy()

Example app

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

Example app

Explore the example application on GitHub.

GitHub repository

iOS SDK repository

View the source code, releases, and API documentation on GitHub.