I want to initData
for two view controllers that I don't want to present immediately.
Atm I have when a user taps a tableViewCell
(select a group) they are presented with "chatVC" and the appropriate data is presented. In ChatVC
the user can access two other VC, ChatInfoVC
and ChatInfoSettingsVC
. Is there a way to pass the right info from the tableViewCell (the group as I do when I present the ChatVC
) to both the other VC? I'm pulling all data from Firebase.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let chatVC = storyboard?.instantiateViewController(withIdentifier: "chat") as? ChatVC else { return }
chatVC.initData(forGroup: groupsArray[indexPath.row])
presentDetail(chatVC)
}
I appreciate all help.