Created
August 15, 2020 17:38
-
-
Save TungVuDuc2805/66c60726d359fb3329672649280dc23f 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
init(){ | |
let layout = UICollectionViewCompositionalLayout { (section, env) -> NSCollectionLayoutSection? in | |
// 1 | |
let item = NSCollectionLayoutItem(layoutSize: .init(widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(200))) | |
// 2 | |
let group = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(200)), subitems: [item]) | |
// 3 | |
let section = NSCollectionLayoutSection(group: group) | |
return section | |
} | |
super.init(collectionViewLayout: layout) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment