Add assertion to flow layout inspector down casting

This commit is contained in:
Levi McCallum
2015-10-21 23:04:21 -07:00
parent db0a0326d7
commit 084d60883b

View File

@@ -256,6 +256,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{
if (_flowLayoutInspector == nil) {
UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionViewLayout;
ASDisplayNodeAssertNotNil(layout, @"Collection view layout must be a flow layout to use the built-in inspector");
_flowLayoutInspector = [[ASCollectionViewFlowLayoutInspector alloc] initWithCollectionView:self
flowLayout:layout];
}