Asset presence of async delegate before accessing layout delegate

This commit is contained in:
Levi McCallum
2015-10-06 09:27:17 -07:00
parent 8efca60bac
commit 2958c848aa

View File

@@ -743,16 +743,19 @@ static BOOL _isInterceptedSelector(SEL sel)
- (ASSizeRange)dataController:(ASCollectionDataController *)dataController constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
ASDisplayNodeAssert(_layoutDelegate != nil, @"ASCollectionView must have a layoutDelegate for layout inspection");
return [_layoutDelegate collectionView:self constrainedSizeForSupplementaryNodeOfKind:kind atIndexPath:indexPath];
}
- (NSUInteger)dataController:(ASCollectionDataController *)dataController supplementaryViewsOfKind:(NSString *)kind inSection:(NSUInteger)section
{
ASDisplayNodeAssert(_layoutDelegate != nil, @"ASCollectionView must have a layoutDelegate for layout inspection");
return [_layoutDelegate collectionView:self supplementaryViewsOfKind:kind inSection:section];
}
- (NSUInteger)dataController:(ASCollectionDataController *)dataController numberOfSectionsForSupplementaryKind:(NSString *)kind;
{
ASDisplayNodeAssert(_layoutDelegate != nil, @"ASCollectionView must have a layoutDelegate for layout inspection");
return [_layoutDelegate collectionView:self numberOfSectionsForSupplementaryKind:kind];
}