Many apps using tables will allow you to manage the list directly from the table view. As a simple new feature, we can do this for the watchlist and favorites list.
To get the "swipe to "delete" functionality, you'll want to implement some methods on your watchlist or favorites view controllers.
In tableView(_:commit:forRowAt:), once you know the movie that's been deleted, you can simply remove it from the watchlist/favorites list using the same methods you used in MovieDetailViewController, and don't forget to update the lists in MovieModel accordingly.
Many apps using tables will allow you to manage the list directly from the table view. As a simple new feature, we can do this for the watchlist and favorites list.
To get the "swipe to "delete" functionality, you'll want to implement some methods on your watchlist or favorites view controllers.
tableView(_:canEditRowAt:)
: https://developer.apple.com/documentation/uikit/uitableviewdatasource/1614900-tableviewtableView(_:commit:forRowAt:)
: https://developer.apple.com/documentation/uikit/uitableviewdatasource/1614871-tableviewIn
tableView(_:commit:forRowAt:)
, once you know the movie that's been deleted, you can simply remove it from the watchlist/favorites list using the same methods you used inMovieDetailViewController
, and don't forget to update the lists inMovieModel
accordingly.