Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

IOS16: NSInternalInconsistencyException: UICollectionViewLayoutAttributes: -setSize: requires finite dimensions #243

Open
dreampowder opened this issue Jul 19, 2022 · 1 comment

Comments

@dreampowder
Copy link
Contributor

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.

@dreampowder dreampowder changed the title Rando NSInternalInconsistencyException: UICollectionViewLayoutAttributes: -setSize: requires finite dimensions Jul 19, 2022
@dreampowder
Copy link
Contributor Author

looks like this is an ios16 bug, similar to the tableview bug mentioned in another issue
Screen Shot 2022-07-19 at 16 52 02
Screen Shot 2022-07-19 at 16 51 50

@dreampowder dreampowder changed the title NSInternalInconsistencyException: UICollectionViewLayoutAttributes: -setSize: requires finite dimensions IOS16: NSInternalInconsistencyException: UICollectionViewLayoutAttributes: -setSize: requires finite dimensions Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant