From 348b11da4f1f52071888f93296e28991a0b5ffdf Mon Sep 17 00:00:00 2001 From: Roman Klauke Date: Thu, 27 Oct 2016 14:25:54 -0700 Subject: [PATCH] reword some assertions with more informations Summary: This commit changes some assertion texts. No behavior is changed; no assertions are added (just reworded). Some of them were short or contained no real meaningful informations, where the error probably is. Ref: #113 - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/122 Differential Revision: D4090470 Pulled By: rnystrom fbshipit-source-id: 96f492a1efd258ec3424ce334802229fdbdee191 --- Source/IGListAdapter.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/IGListAdapter.m b/Source/IGListAdapter.m index 2a3b90f5..34a706b9 100644 --- a/Source/IGListAdapter.m +++ b/Source/IGListAdapter.m @@ -286,7 +286,7 @@ } UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Reloading adapter without a collection view"); + IGAssert(collectionView != nil, @"Tried to reload the adapter without a collection view"); [self.updatingDelegate reloadCollectionView:collectionView sections:sections]; } @@ -717,7 +717,7 @@ IGParameterAssert(cellClass != nil); IGParameterAssert(index >= 0); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Reloading adapter without a collection view."); + IGAssert(collectionView != nil, @"Dequeueing cell of class %@ from section controller %@ without a collection view at index %zi", NSStringFromClass(cellClass), sectionController, index); NSString *identifier = IGListReusableViewIdentifier(cellClass, nil, nil); NSIndexPath *indexPath = [self indexPathForSectionController:sectionController index:index]; if (![self.registeredCellClasses containsObject:cellClass]) { @@ -748,7 +748,7 @@ IGParameterAssert(sectionController != nil); IGParameterAssert(index >= 0); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Reloading adapter without a collection view."); + IGAssert(collectionView != nil, @"Dequeueing cell with nib name %@ and bundle %@ from section controller %@ without a collection view at index %zi.", nibName, bundle, sectionController, index); NSIndexPath *indexPath = [self indexPathForSectionController:sectionController index:index]; if (![self.registeredNibNames containsObject:nibName]) { [self.registeredNibNames addObject:nibName]; @@ -768,7 +768,7 @@ IGParameterAssert(viewClass != nil); IGParameterAssert(index >= 0); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Reloading adapter without a collection view."); + IGAssert(collectionView != nil, @"Dequeueing cell of class %@ from section controller %@ without a collection view at index %zi with supplementary view %@", NSStringFromClass(viewClass), sectionController, index, elementKind); NSString *identifier = IGListReusableViewIdentifier(viewClass, nil, elementKind); NSIndexPath *indexPath = [self indexPathForSectionController:sectionController index:index]; if (![self.registeredSupplementaryViewIdentifiers containsObject:identifier]) { @@ -783,7 +783,7 @@ IGParameterAssert(indexes != nil); IGParameterAssert(sectionController != nil); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Reloading from %@ without a collection view.", sectionController); + IGAssert(collectionView != nil, @"Tried to reload the adapter from %@ without a collection view at indexes %@.", sectionController, indexes); if (indexes.count == 0) { return; @@ -798,7 +798,7 @@ IGParameterAssert(indexes != nil); IGParameterAssert(sectionController != nil); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Inserting items from %@ without a collection view.", sectionController); + IGAssert(collectionView != nil, @"Inserting items from %@ without a collection view at indexes %@.", sectionController, indexes); if (indexes.count == 0) { return; @@ -813,7 +813,7 @@ IGParameterAssert(indexes != nil); IGParameterAssert(sectionController != nil); UICollectionView *collectionView = self.collectionView; - IGAssert(collectionView != nil, @"Deleting items from %@ without a collection view.", sectionController); + IGAssert(collectionView != nil, @"Deleting items from %@ without a collection view at indexes %@.", sectionController, indexes); if (indexes.count == 0) { return;