3lvis / DATASource

Core Data's NSFetchedResultsController wrapper for UITableView and UICollectionView
Other
106 stars 27 forks source link

Fix duplicate cell in UI while moving rows within one section. #64

Closed zarv1k closed 8 years ago

zarv1k commented 8 years ago

While implementing the edit of my entity using DATASource I found the issue. After edit while moving rows within one section I noticed duplicate rows. In my branch I modified your 'tableSwift' example a bit for explain the issue and have record video with this strange behaviour. After simple debug I noticed the overhead of call of configureCell method in implementation of NSFetchedResultsControllerDelegate. Have fixed that.

Also I suppose that this code is not needed too but I'm not sure because I can't reproduce this 'Update' behaviour. Could you please take a look? Thank you.

3lvis commented 8 years ago

Woah! Nice catch 😀

zarv1k commented 8 years ago

@3lvis, I have few questions for you:

1.

Also I suppose that this code is not needed too but I'm not sure because I can't reproduce this 'Update' behaviour. Could you please take a look? Thank you.

What about this? May be UITableView:reloadRowsAtIndexPaths: should called here instead of call configureCell?

2. Could you please tag the latest changes? Thanks.

3lvis commented 8 years ago

UITableView:reloadRowsAtIndexPaths could work too but it has a weird animation, if many cases the cell blinks or flashes before being updated.