0

How can I override layoutAttributesForElements in UICollectionViewCompositionalLayout ?

    func createCompositionalLayout() -> UICollectionViewLayout {
        let layout = UICollectionViewCompositionalLayout { sectionIndex, layoutEnvironment in

        return layout
    }
}
rupesh45
  • 125
  • 2
  • 8

1 Answers1

-2

Are you just trying to create one stretchy header at the top of a UICollectionView?

If so, you can add a UIView, which is your "stretchy header", to your UICollectionView, then you can do something like:

import SnapKit


// ...

header.snp.makeConstraints { (make) in
    make.top.left.right.equalTo(self.view)
    make.bottom.equalToSuperview()
}

Btw, I assumed we are using SnapKit!

Josh Arnold
  • 249
  • 4
  • 8