I have an UITableView with multiple sections. I want to show/hide the checkmark accessory in the cell when the cell is clicked. I could have done this by using a MutableArray if there was only one section as mentioned in this answer Set checkmark in UITableView. But how can I do it if there are multiple sections?
Asked
Active
Viewed 222 times
1 Answers
1
If you have multiple sections, instead of an array, you can use... an array of arrays !

Vinzzz
- 11,746
- 5
- 36
- 42
-
Can you please explain your answer with a sample code? – ChaturaM Nov 03 '14 at 01:14
-
It's the same as the link you provide, only you repeat the same pattern - using a MutableArray with Booleans for 'checkmak' and some data object for the cell - but for each section. So basically, your build a MutableArray of MutableArray of dictionaries with Boolean & data object – Vinzzz Nov 03 '14 at 01:36
-
Thanks. I just figured it out. – ChaturaM Nov 03 '14 at 01:42