Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo preventing UITableView animations #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix typo preventing UITableView animations #19

wants to merge 1 commit into from

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