In my project, I use UICollectionView to display a grid of icons.
The user can reorder by clicking on a segmented control that calls a selection from the master data using another NSSortDescriptor.
The amount of data is always the same, only ending in different sections / lines:
- (IBAction)sortSegmentedControlChanged:(id)sender { _fetchedResultsController = nil; _fetchedResultsController = [self newFetchResultsControllerForSort]; NSError *error; if (![self.fetchedResultsController performFetch:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); } [self.collectionView reloadData]; }
The problem is that reloadData does not revitalize the changes, the UICollectionView just appears with new data.
Should I keep track of which cell indexPath was before and after the change, and use [self.collectionView moveItemAtIndexPath: toIndexPath:] to do the animation for the change, or is there a better method?
I haven't gotten much in subclassing collectionViews, so any help would be great ...
Thanks Bill.
ios uicollectionview
Nimrod7 Nov 07 2018-12-12T00: 00Z
source share