Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 9, 2020 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/e5c39b4d519af3902372818df0aef6dc to your computer and use it in GitHub Desktop.
Save zontan/e5c39b4d519af3902372818df0aef6dc to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let friendID = resultsArray[indexPath.row]["displayname"] {
performSegue(withIdentifier: "showChat", sender: friendID)
}
tableView.deselectRow(at: indexPath, animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "showChat" {
if let friendID = sender as? String, let destination = segue.destination as? ChatViewController {
destination.friendID = friendID
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment