kishikawakatsumi / IBPCollectionViewCompositionalLayout

Backport of UICollectionViewCompositionalLayout to earlier iOS 12
MIT License
1.55k stars 148 forks source link

IBPCollectionCompositionalLayoutSolverResult is empty and crashed #139

Closed ultimatevegance closed 1 year ago

ultimatevegance commented 4 years ago

uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'


- (IBPNSCollectionLayoutItem *)layoutItemAtIndexPath:(NSIndexPath *)indexPath {
    NSArray<IBPCollectionCompositionalLayoutSolverResult *> *results = self.results;
    IBPCollectionCompositionalLayoutSolverResult *result = [results objectAtIndex:indexPath.item % results.count];
    return result.layoutItem;
}
alphatroya commented 4 years ago

I think #136 will resolve that issue