Skip to content

Commit 81a9ae4

Browse files
authored
Fix a crash on orthogonal sections using a background view
1 parent 678a463 commit 81a9ae4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/IBPCollectionViewCompositionalLayout/IBPUICollectionViewCompositionalLayout.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,15 @@ - (UICollectionView *)setupOrthogonalScrollViewForSection:(IBPNSCollectionLayout
487487
configuration:configuration];
488488
collectionViewLayout.parent = self;
489489
collectionViewLayout.containerSection = section;
490+
491+
NSDictionary *decorationClassDict = @{};
492+
@try {
493+
decorationClassDict = [[self valueForKey:@"_decorationViewClassDict"] copy];
494+
} @catch (NSException *exception) {}
495+
for (NSString *reuseIdentifier in decorationClassDict) {
496+
Class cellClass = decorationClassDict[reuseIdentifier];
497+
[collectionViewLayout registerClass:cellClass forDecorationViewOfKind:reuseIdentifier];
498+
}
490499

491500
IBPCollectionViewOrthogonalScrollerEmbeddedScrollView *scrollView = [[IBPCollectionViewOrthogonalScrollerEmbeddedScrollView alloc] initWithFrame:CGRectZero
492501
collectionViewLayout:collectionViewLayout];

0 commit comments

Comments
 (0)