// ios/EncryptedChat/UsersViewController.swift:32 | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
let userId = Account.shared.userId! | |
let userToChatWith = users[tableView.indexPathForSelectedRow!.row] | |
let channelId = [userId, userToChatWith].sorted().joined(separator: "-") | |
let viewController = segue.destination as! EncryptedChatViewController | |
let channelPresenter = ChannelPresenter( | |
channel: Client.shared.channel( | |
type: .messaging, | |
id: channelId, | |
members: [User(id: userId), User(id: userToChatWith)] | |
) | |
) | |
viewController.user = userId | |
viewController.otherUser = userToChatWith | |
viewController.presenter = channelPresenter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment