I have faced an issue related to the NSCollectionLayoutSection in UICollectionViewCompositionalLayout. Here is my code to set a section in collection view.
let item = NSCollectionLayoutItem.init(layoutSize: .init(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1)))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: .init(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1)), subitems: [item])
section = NSCollectionLayoutSection(group: group)
section.contentInsets = .init(top: 15, leading: 0, bottom: 0, trailing: 0)
The above code works correctly on iOS versions less than 17. But on iOS 17, the content insets of this section always equal 0. This is an empty section; may this be a root cause on iOS 17?
It would be appreciated if you could help me on this issue.