-
-
Save zontan/a727eb0a20d45f4ac432245e88209569 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
let userData = resultsArray[indexPath.row] | |
performSegue(withIdentifier: "startCall", sender: userData) | |
} | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
// Get the new view controller using segue.destination. | |
// Pass the selected object to the new view controller. | |
if segue.identifier == "startCall" { | |
guard let userData = sender as? [String: String] else { | |
assert(false, "startCall segue triggered improperly") | |
return | |
} | |
if let videoController = segue.destination as? AgoraVideoViewController { | |
let uids = [currentUser?.uid ?? "", userData["uid"] ?? ""].sorted { $0 < $1 } | |
let channelName = uids[0] + uids[1] | |
videoController.setChannelName(channel: channelName) | |
videoController.setUserName(name: currentUser?.displayName) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment