Swift

Building the interface

To be able view the connection status of the app you will need to add a UILabel element to the screen. Open ViewController.swift and add the label programmatically by replacing the entire file content with the following:

import UIKit
import VonageClientSDKVoice

class ViewController: UIViewController {

    let connectionStatusLabel = UILabel()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        
        connectionStatusLabel.text = "Disconnected"
        connectionStatusLabel.textAlignment = .center
        connectionStatusLabel.translatesAutoresizingMaskIntoConstraints = false
        
        view.addSubview(connectionStatusLabel)
        
        NSLayoutConstraint.activate([
            connectionStatusLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            connectionStatusLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor)
        ])
    }
}

Build and Run

Run the project again (Cmd + R) to launch it in the simulator.

Interface