Multiple unwind segues from a UITableView?

Hi, on page 111-114 in Tutorial 3 My Locations I read about how to connect one unwind segue from a tableview cell. That’s working fine but how to do if I need one tableview to have unwind segues to three different tableviews? I’m currently building an app that uses the same countryPickerTableView in three different places with slightly different behaviour, so I would need a way to connect different unwind segues to the cell, the problem is that the cell only allows me to pick one unwind Action. Is there a solution to this?

BR /Diez

Do you mean that you will have different unwind segues based on the content of the cell? If so, you could either do multiple prototype cells for each type of content, or handle the unwind segue via code. This would depend on the situation - for example, if you have multiple table view rows which use the same unwind segue but you also have multiple types of unwind segues, then using multiple prototype cells might make sense.

On the other hand, if you need to use multiple unwind segues but you must have only one prototype cell (or the unwind segues actually match up with only one row from the table), you might want to consider performing the segue via code depending on the chosen cell.

Hope this helps :slight_smile:

This topic was automatically closed after 166 days. New replies are no longer allowed.