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 Substitution Indexes #16

Merged
merged 5 commits into from
Mar 11, 2016
Merged

Fix Substitution Indexes #16

merged 5 commits into from
Mar 11, 2016

Conversation

osteslag
Copy link
Owner

Fixes #12 by correcting .Substitution indexes to point into the source collection as documented by Apple.

Related: .Move edit indexes are currently incompatible with table/collection view animation blocks. This would cause the test app to throw an exception. So instead of calling moveRowAtIndexPath and moveItemAtIndexPath with .Move indexes, moves are now composed by deletion/insertion pairs. This issue will be fixed separately.

Simply following the documentation:

> Deletion and reloading operations within an animation block specify
> which rows and sections in the original table should be removed or
> reloaded; insertions specify which rows and sections should be added
> to the resulting table.
That is, those tests where a .Substitution is preceeded by .Insertion or
.Deletion.
Instead of including the source file in the test target.
Instead, from .Move edits, do corresponding deletions and insertions.

The calls, moveRowAtIndexPath and moveItemAtIndexPath, don't currently
work with the indexes in Changeset. This will be fixed in a future
version.
osteslag pushed a commit that referenced this pull request Mar 11, 2016
@osteslag osteslag merged commit 213505b into master Mar 11, 2016
@osteslag osteslag deleted the osteslag/12-fix-data-source branch March 11, 2016 18:32
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.

Changeset produces bad edit steps, crashes UICollectionView.
1 participant