NSCollectionView Supplementary items are hidden in horizontal scroll direction configuration.

Hello!

I am trying to build a collection view, which sections are rendered horizontally, but sections items are rendered vertically (like a board). It looks like that:

Code Block swift
func createCompositionalLayout() -> NSCollectionViewLayout {
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(300))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(300))
let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitem: item, count: 1)
let section = NSCollectionLayoutSection(group: group)
section.interGroupSpacing = 10
section.orthogonalScrollingBehavior = .continuous
let layoutSectionHeaderItemSize = NSCollectionLayoutSize(widthDimension: .absolute(300), heightDimension: .absolute(200))
let layoutSectionHeaderItem = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: layoutSectionHeaderItemSize, elementKind: NSCollectionView.elementKindSectionHeader, alignment: .top)
section.boundarySupplementaryItems = [layoutSectionHeaderItem]
let configuration = NSCollectionViewCompositionalLayoutConfiguration()
configuration.scrollDirection = .horizontal
configuration.interSectionSpacing = 10
let layout = NSCollectionViewCompositionalLayout(section: section, configuration: configuration)
return layout
}


The problem lies here in two parts of code:
  1. scrollDirection (line 18)

  2. Header's code (lines 12-15)

When the code is written like above, header is rendered scrollView of each section (I was able to see that with View Hierarchy tool built in Xcode), but when I comment out scrollDirection line code, headers are perfectly visible, but the layout doesn't look like I would like to.

Is it a bug? I am not sure what can I do in this case.

Regards!
NSCollectionView Supplementary items are hidden in horizontal scroll direction configuration.
 
 
Q