iOS UI Kit — Installation

The iOS UI Kit (Enx_UIKit_iOS) can be installed manually by dragging the framework into your Xcode project, automatically via CocoaPods, or via Swift Package Manager (SPM). CocoaPods and SPM are both recommended paths — they handle the EnableX iOS SDK and Socket.IO dependencies automatically without requiring separate downloads.

Software Requirements
Option A — Manual Installation

Use the manual method if you manage dependencies outside CocoaPods or need to pin a specific framework build. You will add the UI Kit framework directly to Xcode and then install the underlying SDK and socket library via a Podfile.

  1. Download the iOS UI Kit from the Downloads page (Enx_UIKit_iOS.xcframework_2.2.2.zip).
  2. Unzip the archive and drag the Enx_UIKit_iOS files into your Xcode target under Target → Frameworks, Libraries, and Embedded Content.
  3. In your project directory, initialise a Podfile if you do not already have one:
    pod init
  4. Edit the Podfile to add the EnableX iOS SDK and the Socket.IO client:
    pod 'EnxRTCiOS'
    pod 'Socket.IO-Client-Swift', '~> 16.1.1'
  5. Install the pods:
    pod install
  6. Open the generated .xcworkspace file (not .xcodeproj) from this point forward.
Option B — Install via CocoaPods (Recommended)

CocoaPods resolves and installs the EnableX iOS SDK and Socket.IO automatically as transitive dependencies. This is the fastest path to a working integration.

  1. Navigate to your project directory in Terminal.
  2. Run pod init to create a Podfile (skip if one already exists):
    pod init
  3. Add the UI Kit pod to your Podfile:
    pod 'Enx_UIKit_iOS'
  4. Install:
    pod install
  5. Open the generated .xcworkspace file in Xcode.
Do not duplicate dependencies

When installing via CocoaPods, do not manually add EnxRTCiOS again — it is pulled in automatically as a dependency of Enx_UIKit_iOS. However, Socket.IO-Client-Swift is not installed automatically; you must declare it explicitly in your Podfile (pod 'Socket.IO-Client-Swift', '~> 16.1.1'). Omitting it will cause a missing-symbol build error; adding EnxRTCiOS a second time will cause symbol conflicts at link time.

Option C — Swift Package Manager (SPM)

SPM is built into Xcode and requires no external tools. This is the lightest-weight installation path — Xcode fetches the Enx_UIKit_iOS package directly from GitHub and resolves its dependencies automatically, including EnablexWebRTC.

Adding via Xcode

  1. Open your project in Xcode.
  2. Go to File → Add Package Dependencies…
  3. Enter the repository URL:
    https://github.com/EnableX/Enx_UIKit_iOS.git
  4. Select the version rule — choose Up to Next Major from 2.1.12.
  5. Click Add Package and add it to your app target.

Adding via Package.swift

If you manage dependencies through a Package.swift file, add the following to your dependencies array:

.package(url: "https://github.com/EnableX/Enx_UIKit_iOS.git", from: "2.1.12")

Importing the library

In any Swift file where you use the UI Kit, add the import at the top:

import Enx_UIKit_iOS
WebRTC vs Socket.IO — what SPM handles automatically

When installed via SPM, EnablexWebRTC is fetched and linked automatically — you do not need to download or drag in the WebRTC framework separately. Socket.IO-Client-Swift is not included as an SPM dependency and must be added to your project independently: either add the socket.io-client-swift package via File → Add Package Dependencies in Xcode, or declare it in your Package.swift.

Define Permissions

iOS requires your app to request camera and microphone access at runtime, and to declare a usage description in Info.plist. The UI Kit will not function without both steps.

Request at Runtime

Call the following helper early in your app lifecycle — for example, in viewDidLoad of the view controller that hosts the video session:

private func getPrivacyAccess() {
    let vStatus = AVCaptureDevice.authorizationStatus(for: .video)
    if vStatus == .notDetermined {
        AVCaptureDevice.requestAccess(for: .video) { _ in }
    }

    let aStatus = AVCaptureDevice.authorizationStatus(for: .audio)
    if aStatus == .notDetermined {
        AVCaptureDevice.requestAccess(for: .audio) { _ in }
    }
}

Add Usage Descriptions to Info.plist

Add the following keys to your app's Info.plist. Apple requires a human-readable explanation for each permission:

App Store rejection risk

Submitting to the App Store without both NSCameraUsageDescription and NSMicrophoneUsageDescription will cause an automatic rejection. Add both keys even if you plan to support audio-only sessions, because the SDK may request camera access during initialisation.

Obtain a Token

You need a valid EnableX room token from your application server to join a session. The token encodes the room credentials and the joining participant's role and identity. See the Video API reference for instructions on creating rooms and generating tokens server-side.

Never generate tokens client-side

Token generation requires your EnableX App ID and App Key, which are secret credentials. Always call the EnableX API from your server and pass the resulting token to your iOS app securely (e.g., over HTTPS). Embedding credentials in the app binary exposes them to extraction.