Using Accessory View to display progress through a tableView

338 views Asked by At

I am trying to use the accessory view of a UITableViewCell to indicate progress through a table by having a checkmark appear when the steps on the detail view controller associated with that tableViewCell are completed. I have found many ways to make all of the cells display the checkmark regardless of their associated steps being completed, but I can't figure out (or find any sample code or documentation) how to make their appearance conditional.

Does anyone have any ideas?

1

There are 1 answers

1
Doyle On BEST ANSWER

In your detail view you can have it write out to a text file as to the completed state of that subMenu.

ex:

detailview1:0 detailview2:1 detailview3:0

if (detailviewID == 0) cell.checkmark.hidden = FALSE;

Then when your view is popped back to TableView have your viewWillAppear read the text file and determine if the lesson is completed. If it is true have the check mark unhidden.

Remember you will need to write out to this file on appWillTerminate and appWillEnter Background. That way the users progress will be saved on exit.