Skip to content

Conversation

dohyeondk
Copy link

In the switch below, deleteRows() or insertRows was not reached because of this typo.

switch (changeReason, newValue, oldValue) {
case let (Item.removed, _, (oldIndex as Int)?):
	tableView.deleteRows(at: [IndexPath(row: oldIndex, section: 0)], with: .automatic)
case let (Item.added, (newIndex as Int)?, _):
	tableView.insertRows(at: [IndexPath(row: newIndex, section: 0)], with: .automatic)
case let (Item.renamed, (newIndex as Int)?, (oldIndex as Int)?):
	tableView.moveRow(at: IndexPath(row: oldIndex, section: 0), to: IndexPath(row: newIndex, section: 0))
	tableView.reloadRows(at: [IndexPath(row: newIndex, section: 0)], with: .automatic)
default:
	tableView.reloadData()
}

@dohyeondk
Copy link
Author

@chriseidhof can you review this?

@ralfebert
Copy link

This typo is also detected by the unit tests in the MVC project - testChangeNotificationHandling fails if you run the tests out of the box - this change fixes the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants