Swift

Overview

Show the merged observability metrics on top of the call UI so you can see live quality data during a session. Based on what you observe, you can add thresholds later (for example, show a poor-connection message when networkDegradationSource is .local).

Display Stats in the UI

Use a small ObservabilityStats model in your project to hold overlay fields (bandwidth, packet loss, degradation source, network condition labels).

1. Host Publisher and Subscriber Views

Reuse a UIViewRepresentable wrapper (as in the Basic video chat (Swift) tutorial) to embed OTPublisher and OTSubscriber views in SwiftUI:

2. Stats Overlay

Wire @Published var latestObservabilityStats on VonageVideoManager so SwiftUI refreshes when delegate callbacks update state on the main queue.

3. iOS App Lifecycle

iOS-specific: Unlike the Android SDK’s session.onPause() / onResume(), iOS apps typically rely on ScenePhase, audio session interruptions, and your own policy when backgrounding during a call. If the app backgrounds, stats may pause or stop until the session is active again—test on a physical device for realistic network behavior.

Next: Run with a second participant and confirm the overlay updates.