Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created April 1, 2022 09:00
Show Gist options
  • Save KrauserHuang/68582d0f3de54fbe68cf5c79e341b3b7 to your computer and use it in GitHub Desktop.
Save KrauserHuang/68582d0f3de54fbe68cf5c79e341b3b7 to your computer and use it in GitHub Desktop.
let tripleItem = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1/3),
heightDimension: .fractionalHeight(1))
tripleItem.contentInsets = NSDirectionalEdgeInsets(top: 2, leading: 2, bottom: 2, trailing: 2)
let tripletGroup = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalWidth(2/9)),
subitem: tripleItem,
count: 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment