Reputation: 416
my Storyboard looks like:
User can go directly from the 1st screen to the 4th. The fourth screen contains tableView, with XIB cell design. I want user to be able to tap on a cell and get to the 3rd screen and send some data with that. I know this should be done in didSelectRowAt
. But is it even possible?
Upvotes: 0
Views: 53
Reputation: 1015
Yes it is possible.
indentifier
attribute under the Indentity Inspector tab.didSelectRowAt
, add the following line:self.performSegue(withIdentifier: "THE_ID_YOU_ASSIGNED_IN_STEP_2")
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "THE_ID_YOU_ASSIGNED_IN_STEP_2" {
if let destinationVC = segue.destination as? YOUR_SCREEN_3_VC {
// Send data to your VC, such as assigning values
}
}
}
Upvotes: 1