I have an app, where I have three hierarchical tableViews
. The first one is a tableView
with all the clubs of the user. When he selects a club he gets to the ViewController
, where all the members of the selected clubs are displayed.
In the code it looks like this:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let destinationVC: UIViewController
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "memberViewController") as! MemberViewController
destinationVC = vc
let selectedRow = self.tableViewClub.indexPathForSelectedRow?.row
vc.club = clubs[selectedRow!]
}
self.navigationController?.pushViewController(destinationVC, animated: true)
}
Problem
Then I can access the members of this club in the MemberViewController
. And now I want to transfer the data again but this time to another ViewController
which is connected to the MemberViewController
with a segue
.
Question
How can I transfer the members of the club to the ViewController
- which is connected to the MemberViewController
by a segue - since there is no selected row I can write in the code.