Gold Challenge: Favorite Items

Allow the user to select favorite items by swiping right on them. You will want to use the table view edit actions to accomplish this. This is a bit involved; you will need to:

  1. Add an isFavorite property to the Item class.

  2. Investigate the UITableViewDataSource for a way to add edit actions to a row, then implement this to toggle the isFavorite property on the item.

  3. Display whether an item is favorited. This could be done by appending (Favorite) to the item’s name on the textLabel property.

Bonus: Implement a way to show only favorited items. This could be done with an additional button in the table view header view that toggles which items are displayed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset