Chapter 20: Exercise: display due date under to-do

I have a question about this exercise. I have completed it and it works well but wanted to solicit if what I did was the best approach.

Rather than use a Table View Cell set to subtitle, I simply added another label into the existing Cell and tagged it 1002 and did my label updates as the others. In the process I did create a makeCell function as is done with the table view of checklists as I was attempting to create cells with subtitle but the tagging or something seemed to get in the way.

So is the other solution to do a subtitle cell rather than the way I did it?



No, the way you did it is the correct way :slight_smile: Each table view cell in the table view for the Checklist scene displays one item. If you added a secondary table view cell, the item display gets complicated since each set of two rows would be for one item. While it’s possible to do it this way, handling cell selection (or even displaying data) for two sets of cells for the same data item would become more complicated.

So, using one table cell and adding extra UI components to it as you did is the cleaner and simpler solution :slight_smile:

This topic was automatically closed after 166 days. New replies are no longer allowed.