How can I add a UITableView into my View-Based Application where the user will tap on more than one cell, and it will become selected, exactly like the Clock app’s “New Alarm” setting named “Repeat” (Clock>Alarms> + >Repeat), and how can I get all of the selected cells in an array?
Share
In your implementation of
-tableView:didSelectRowAtIndexPath:you would set the table view cell’saccessoryTypeproperty depending on its current value (so it would toggle on and off with multiple taps). For example:You could either maintain an array of selected states in addition to the cells’ own accessory type state, or iterate over the cells in the table view querying for each one’s state in order to read out the selected rows.