IOS16: NSInternalInconsistencyException: UICollectionViewLayoutAttributes: -setSize: requires finite dimensions
dreampowder opened this issue · comments
Serdar Coşkun commented
Hello, first of all, thanks a lot for this wonderful library.
From time to time, i see a random crash log in crashlytics, which i couldn't reproduce on my side whatever i do.
Fatal Exception: NSInternalInconsistencyException
UICollectionViewLayoutAttributes: -setSize: requires finite dimensions <UICollectionViewLayoutAttributes: 0x14b2c0140> index path: (1-0); element kind: (groupBackground); frame = (0 377.667; 390 294.333); alpha = 0; - {inf, inf}
the groupBackground is registered like this:
var collectionViewLayouts:ASCollectionLayout<SeasonScreenSections>{
let layout = ASCollectionLayout<SeasonScreenSections>(scrollDirection: .vertical, interSectionSpacing: 0.0,layoutPerSection: {sectionId in
switch(sectionId){
case .beatpacks:
return SeasonLayoutGenerator.beatpackLayout(columnCount: 2)
case .spotlight:
return SeasonLayoutGenerator.beatpackLayout(columnCount: 1)
case .creators:
return SeasonLayoutGenerator.creatorLayout()
case .season_header:
return SeasonLayoutGenerator.seasonHeaderLayout(height: seasonImgHeight ?? 0)
}
}).decorationView(GroupBackground.self, forDecorationViewOfKind: "groupBackground")
return layout
}
and GroupBackground is like this:
struct GroupBackground: View, Decoration
{
var body: some View
{
Color.gray
}
}
Thanks a lot for your time.
Serdar Coşkun commented