Cesare
Cesare

Reputation: 9419

How to tell apart prototype table view cells?

Say I have a table view with a single prototype cell in it that contains a stack view. I'd like each cell of the table view generated from the prototype cell to have different views in the stack view. So, I need to find a way to tell table view cells apart.

If the table view had static cells, I could just use the tag property of the cell and populate stack views easily. Though, using static cells is probably not the best approach since cells are almost identical to each other.

What can I do to populate stack view differently depending on the "row" of the table view cells?

Upvotes: 0

Views: 38

Answers (1)

jcaron
jcaron

Reputation: 17720

That's precisely what you should be doing in your tableView:cellForRowAtIndexPath: method.

Upvotes: 1

Related Questions