class SimpleCallViewController: UIViewController {
// 생략
// 1:1 통화를 위한 채널에 접속합니다.
@IBAction func connectChannel(_ sender: Any) {
self.view.endEditing(true)
// 입력된 채널명(채널ID)
let channelID = self.chField.text
if channelID != nil && channelID!.count > 0 {
// config는 별도 설정한 뒤에 전달해도 되며, nil 인 경우 remonCall 내부 프로퍼티 값을 사용하게 됩니다.
// 내부 프로퍼티는 IB에서 설정할 수 있습니다.
remonCall.connect(channelID!, customConfig)
self.chLabel.text = channelID
} else {
// 랜덤번호를 채널명으로 사용하는 예
let randChannelID:String! = String(arc4random_uniform(9999))
remonCall.connect(randChannelID, customConfig)
self.chLabel.text = randChannelID
}
}
// 생략
}