mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-23 09:18:29 +00:00
Add asserts to IGListAdapter
Summary: Fix #91 Closes https://github.com/Instagram/IGListKit/pull/108 Differential Revision: D4063183 Pulled By: rnystrom fbshipit-source-id: 8ff4a5ac3bf7418cb968093e9f87b7fc55bc2fe1
This commit is contained in:
parent
adbb21fd9d
commit
a01e9954e3
1 changed files with 7 additions and 0 deletions
|
|
@ -715,6 +715,7 @@
|
|||
IGAssertMainThread();
|
||||
IGParameterAssert(sectionController != nil);
|
||||
IGParameterAssert(cellClass != nil);
|
||||
IGParameterAssert(index >= 0);
|
||||
UICollectionView *collectionView = self.collectionView;
|
||||
IGAssert(collectionView != nil, @"Reloading adapter without a collection view.");
|
||||
NSString *identifier = IGListReusableViewIdentifier(cellClass, nil, nil);
|
||||
|
|
@ -731,7 +732,9 @@
|
|||
forSectionController:(IGListSectionController<IGListSectionType> *)sectionController
|
||||
atIndex:(NSInteger)index {
|
||||
IGAssertMainThread();
|
||||
IGParameterAssert(nibName != nil);
|
||||
IGParameterAssert(sectionController != nil);
|
||||
IGParameterAssert(index >= 0);
|
||||
UICollectionView *collectionView = self.collectionView;
|
||||
IGAssert(collectionView != nil, @"Reloading adapter without a collection view.");
|
||||
NSIndexPath *indexPath = [self indexPathForSectionController:sectionController index:index];
|
||||
|
|
@ -748,6 +751,10 @@
|
|||
class:(Class)viewClass
|
||||
atIndex:(NSInteger)index {
|
||||
IGAssertMainThread();
|
||||
IGParameterAssert(elementKind.length > 0);
|
||||
IGParameterAssert(sectionController != nil);
|
||||
IGParameterAssert(viewClass != nil);
|
||||
IGParameterAssert(index >= 0);
|
||||
UICollectionView *collectionView = self.collectionView;
|
||||
IGAssert(collectionView != nil, @"Reloading adapter without a collection view.");
|
||||
NSString *identifier = IGListReusableViewIdentifier(viewClass, nil, elementKind);
|
||||
|
|
|
|||
Loading…
Reference in a new issue