Chapter 23. Editing LioNs
This chapter covers
- Optional binding
- Editing LioNs
- Adding another function to the AddEditViewControllerDelegate
You’ve built out the functionality to create new LioN objects, but you don’t have the ability to edit them yet. You’ll add all the functionality to edit LioNs and display the edited cells in this chapter. You’ll also add functionality to show whether the user liked or disliked the LioN by changing the background colors of the Like and Dislike buttons.
You’re now going to add the ability for users to edit the LioNs they’ve already created. Based on what you know now, what specifically do you need to do to make this happen?
- Set up the AddEditViewController to accept a LioN object to edit.
- Fill in the text boxes with the existing LioN name and description.
- Show whether the LioN is liked or disliked.
- Pass the LioN object to the AddEditViewController.
- Save the LioN when the user taps Done, but don’t create a new LioN.
Let’s get to it.