Check out example codes for "swift - salesforce chat only". It will help you in understanding the concepts better.

Code Example 1

let POD = "YOUR_POD_NAME"
let ORG_ID = "YOUR_ORG_ID"
let DEPLOYMENT_ID = "YOUR_DEPLOYMENT_ID"
let BUTTON_ID = "YOUR_BUTTON_ID"

Code Example 2

var chatConfig: SCSChatConfiguration?

Code Example 3

override func viewDidLoad() {
  super.viewDidLoad()
  chatConfig = SCSChatConfiguration(liveAgentPod: POD,
                                    orgId: ORG_ID,
                                    deploymentId: DEPLOYMENT_ID,
                                    buttonId: BUTTON_ID)
}

Learn ReactJs, React Native from akashmittal.com