Coeur/CollectionViewCenteredFlowLayout

Xcode 14 Build Error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

JakubMazur opened this issue · 0 comments

Building with Xcode 14 (beta) results in error:

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

image (2)

There is one operation above threshold so to fix it it's enough to split most complex expression into:

let evaluatedCollectionView = (collectionView.bounds.height + evaluatedSectionInset.top - evaluatedSectionInset.bottom - group.reduce(0, { $0 + $1.frame.size.height }) - CGFloat(group.count - 1) * evaluatedMinimumInteritemSpacing)
var origin = evaluatedCollectionView / 2