diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index 2449377fd..01669ca79 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -172,6 +172,13 @@ - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionVi return self; } +- (void)dealloc +{ + if ([self isNodeLoaded]) { + ASDisplayNodeAssert(self.view.superview == nil, @"Node's view should be removed from hierarchy."); + } +} + #pragma mark ASDisplayNode - (void)didLoad diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 05ed5ebf9..10dd6dc9a 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -151,7 +151,12 @@ @interface ASCollectionView ()