I have a table view made of 2 arrays, a “title” and a “description”. I’ve set numberOfRowsInSection, numberOfSectionsInTableView and titleForHeaderInSection.
I’ve added swipe gesture recognisers, swipe to the right and the cell accessory changes to a check mark, swipe to the left and the accessory goes back to the disclosure indicator. All working fine.
I have 2 section headers, one is Complete the other Incomplete. I’d like to have all cells under incomplete by default and when right swiping, the cell’s section header is changed to complete, likewise if swiping left the cell reverts back to the incomplete header.
I’ve tried various things but can’t seem to get my head around it. Originally I was looking to added a button but this way seems more natural.
Any advice appreciated.
Cheers.
You don’t want to change the section header for that cell, you want to put that cell in the other section (complete or incomplete), no?
So you have to put the object that this cell represents in either the complete o incomplete array that feeds your tableView – and remove it from the other one respectively.