Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

UAFilterableResultsChangeType.Move not being called #1

Open
Nemesisprime opened this issue Dec 17, 2015 · 3 comments
Open

UAFilterableResultsChangeType.Move not being called #1

Nemesisprime opened this issue Dec 17, 2015 · 3 comments

Comments

@Nemesisprime
Copy link

Using UAFilterableResultsController to filter a UICollectionView, but noticed an issue.

If we have a list of objects and remove the first item, when moving the second item into the first position, instead of calling UAFilterableResultsChangeType.Move, both UAFilterableResultsChangeType.Delete and then UAFilterableResultsChangeType.Insert called in sequence down the rest of the list.

It's not too big of a deal, but instead of items moving around, they disappear and then reappear in their correct positions (when working with the standard UICollectionLayout).

@Nemesisprime
Copy link
Author

Found the issue in notifyForChangesFrom:fromArray:toArray

NSIndexPath *pathInExisting = [self indexPathOfObject:obj inArray:fromMutable usingKeyPath:nil];

should just be:

NSIndexPath *pathInExisting = [self indexPathOfObject:obj inArray:fromArray usingKeyPath:nil];

@bok-
Copy link
Contributor

bok- commented Dec 18, 2015

Thanks @Nemesisprime. I'll test it out when I have a few moments to spare and commit the fix.

@Nemesisprime
Copy link
Author

If I get a chance before you, I'll submit a PR. Really enjoying so far!

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

No branches or pull requests

2 participants