Reputation: 103
I have two TableView ViewControllers - A and B. In "TableViewController A" each row of a table is a name, taken from a names array:
var names = ["Alex", "Helen", "Kate", "Margo", "Mike", "Tom"]
In "TableViewController A" I can choose several items from a list. As a result I get an indexPathsForSelectedRows
. Lets say, I have chosen Alex and Kate - so indexPathsForSelectedRows
will be [[0,0], [0, 2]]
. After this indexPathsForSelectedRows via segue is send to "TableViewController B".
The question is: What should be written in cellForRowAt method of "TableViewController B" so it shows only those items, that has been selected in "TableViewController A"?
I understand, that somehow have to teach a table in "TableViewController B" that its first cell should take 0
object from names
array and second cell should take object #2
. But up to now I'm failing to figure out a proper code for this.
Upvotes: 1
Views: 61
Reputation: 47
Hope it helps! Happy Coding....
Upvotes: 1