Skip to content

Commit

Permalink
Add diffResult as argument to pass to willCrashWithException: in IGLi…
Browse files Browse the repository at this point in the history
…stAdapterUpdaterDelegate

Summary: This would help us understands what was the diff result from the algorithm and compare it with the `updates` to check what went wrong. Essentially, this would make our debugging easier going forward.

Reviewed By: calimarkus

Differential Revision: D12828892

fbshipit-source-id: 6dc52cdba1adb5a841760b51599e2df4c845c364
  • Loading branch information
lorixx authored and facebook-github-bot committed Oct 30, 2018
1 parent c1bf5f1 commit 039e77e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag

- Renamed `[IGListAdapterUpdatingDelegate listAdapterUpdater:willPerformBatchUpdatesWithCollectionView:]` to `[IGListAdapterUpdatingDelegate listAdapterUpdater:willPerformBatchUpdatesWithCollectionView:fromObjects:toObjects:listIndexSetResult:]` to include more supporting info on updated objects. [Jeremy Cohen] (https://github.com/jeremycohen) (tbd)

- Renamed `[IGListAdapterUpdatingDelegatelistAdapterUpdater:collectionView:willCrashWithException:fromObjects:toObjects:updates:]` to `[ IGListAdapterUpdatingDelegatelistAdapterUpdater:collectionView:willCrashWithException:fromObjects:toObjects:diffResult:updates:]` to include diff result info. [Zhisheng Huang] (https://github.com/lorixx) (tbd)

### Enhancements

- Added `IGListCollectionScrollingTraits` for exposing `UICollectionView` scrolling traits to section controllers via `IGListCollectionContext`. [Adam Stern](https://github.com/adamastern) (tbd)
Expand Down
1 change: 1 addition & 0 deletions Source/IGListAdapterUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ - (void)performBatchUpdatesWithCollectionViewBlock:(IGListCollectionViewBlock)co
willCrashWithException:exception
fromObjects:fromObjects
toObjects:toObjects
diffResult:result
updates:(id)self.applyingUpdateData];
@throw exception;
}
Expand Down
2 changes: 2 additions & 0 deletions Source/IGListAdapterUpdaterDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,15 @@ willPerformBatchUpdatesWithCollectionView:(UICollectionView *)collectionView
@param exception The exception thrown by the collection view.
@param fromObjects The items transitioned from in the diff, if any.
@param toObjects The items transitioned to in the diff, if any.
@param diffResult The diff result that were computed from `fromObjects` and `toObjects`.
@param updates The batch updates that were applied to the collection view.
*/
- (void)listAdapterUpdater:(IGListAdapterUpdater *)listAdapterUpdater
collectionView:(UICollectionView *)collectionView
willCrashWithException:(NSException *)exception
fromObjects:(nullable NSArray *)fromObjects
toObjects:(nullable NSArray *)toObjects
diffResult:(IGListIndexSetResult *)diffResult
updates:(IGListBatchUpdateData *)updates;

@end
Expand Down

0 comments on commit 039e77e

Please sign in to comment.