I have a question about how to adapt UICollectionViewCompositionalLayout for different size classes. Initially I adapted both the diffableDataSource snapshot and the UICollectionViewCompositionalLayout based on the horizontalSizeClass. I wasn't very happy that my datasource (snapshot construction code) needs to know about sizeClasses, it feels like it should only know about data. So I thought why not just return an empty section in the UICollectionViewCompositionalLayout because it get's passed NSCollectionLayoutEnvironment. It works fine but I'm not sure if it's supported or the right way to reason about this. Here's my empty section code.
static var hiddenSection: NSCollectionLayoutSection {
// Note: .zero is regarded by the system as an error, it might crash in the future
let dimension = NSCollectionLayoutDimension.absolute(0.1)
let size = NSCollectionLayoutSize(widthDimension: dimension, heightDimension: dimension)
return NSCollectionLayoutSection(group: NSCollectionLayoutGroup.horizontal(layoutSize: size, subitems: [.init(layoutSize: size), .init(layoutSize: size), .init(layoutSize: size)] ))
}
``` Thank you for any insights!