Created
April 28, 2022 15:08
-
-
Save hlung/2bb32330b7dac36d756b9d3b95bc7180 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let layout = UICollectionViewCompositionalLayout(sectionProvider: { | |
(sectionIndex: Int, layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? in | |
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), | |
heightDimension: .estimated(30)) | |
let item = NSCollectionLayoutItem(layoutSize: itemSize) | |
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), | |
heightDimension: .estimated(30)) | |
let group = NSCollectionLayoutGroup.horizontal( | |
layoutSize: groupSize, | |
subitem: item, | |
count: 1 | |
) | |
let section = NSCollectionLayoutSection(group: group) | |
section.interGroupSpacing = 16 | |
return section | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment