Created
May 29, 2021 19:34
-
-
Save iosdevie/5381b08eb4f2420c71dc789182171d61 to your computer and use it in GitHub Desktop.
This file contains 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
private func createLayout() -> UICollectionViewLayout { | |
//1 | |
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),heightDimension: .fractionalHeight(1.0)) | |
let item = NSCollectionLayoutItem(layoutSize: itemSize) | |
//2 | |
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),heightDimension: .absolute(44)) | |
//3 | |
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,subitems: [item]) | |
let section = NSCollectionLayoutSection(group: group) | |
let layout = UICollectionViewCompositionalLayout(section: section) | |
return layout | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment