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
This commit is contained in:
Roman Klauke 2016-10-27 14:25:54 -07:00 committed by Facebook Github Bot
parent b99776e5b5
commit 348b11da4f

View file

@ -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;