From 64676d5907fbdeccb0dd1f32b601b3f7e3c57533 Mon Sep 17 00:00:00 2001 From: Ryan Nystrom Date: Wed, 31 Jan 2018 15:10:47 -0800 Subject: [PATCH] Add collection view as an exception param and capture data source state on crash Summary: Adding more metadata about the state of the data source at the time of crash. Note that this will be a breaking change to the public repo, but it's on a much-less used API, and since this is very high-pri for us at the moment, I'm willing to make the breakage. Reviewed By: manicakes Differential Revision: D6863683 fbshipit-source-id: e979aea445abc1ea556182cb69758703499e161a --- Source/IGListAdapterUpdater.m | 1 + Source/IGListAdapterUpdaterDelegate.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Source/IGListAdapterUpdater.m b/Source/IGListAdapterUpdater.m index be2f9061..12d4ed30 100644 --- a/Source/IGListAdapterUpdater.m +++ b/Source/IGListAdapterUpdater.m @@ -222,6 +222,7 @@ } } @catch (NSException *exception) { [delegate listAdapterUpdater:self + collectionView:collectionView willCrashWithException:exception fromObjects:fromObjects toObjects:toObjects diff --git a/Source/IGListAdapterUpdaterDelegate.h b/Source/IGListAdapterUpdaterDelegate.h index 9961fd58..534aac6d 100644 --- a/Source/IGListAdapterUpdaterDelegate.h +++ b/Source/IGListAdapterUpdaterDelegate.h @@ -129,12 +129,14 @@ NS_SWIFT_NAME(ListAdapterUpdaterDelegate) Notifies the delegate that the collection view threw an exception in `-[UICollectionView performBatchUpdates:completion:]`. @param listAdapterUpdater The adapter updater owning the transition. + @param collectionView The collection view being updated. @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 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