Post

Replies

Boosts

Views

Activity

Reply to Crash in UICollectionViewCompositionalLayout iOS 13 with decoration views
Okay, I resolved this by invalidating the collectionViewLayout when preforming a search. and checking if we were searching when applying the decoration items.     func configureBackgroundViews(for section: NSCollectionLayoutSection, at sectionIndex: Int) {         if sectionIndex == 0 && isSearching == false {             let sectionBackgroundDecoration = NSCollectionLayoutDecorationItem.background(                 elementKind: FollowingCollectionViewController.sectionBackgroundDecorationFollowing)             section.decorationItems = [sectionBackgroundDecoration]         } else {             let sectionBackgroundDecoration = NSCollectionLayoutDecorationItem.background(                 elementKind: FollowingCollectionViewController.sectionBackgroundDecorationBrowse)             section.decorationItems = [sectionBackgroundDecoration]         }     }
Jul ’20