-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGettingStartedCompositionalLayout.swift
More file actions
33 lines (31 loc) · 1.06 KB
/
GettingStartedCompositionalLayout.swift
File metadata and controls
33 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// GettingStartedCompositionalLayout.swift
// CompositionalLayoutDSL_Example_iOS
//
// Created by Alexandre Podlewski on 12/04/2021.
// Copyright © 2021 Fabernovel. All rights reserved.
//
import UIKit
import CompositionalLayoutDSL
struct GettingStartedCompositionalLayout {
func layout() -> UICollectionViewLayout {
return LayoutBuilder {
Section {
VGroup(count: 1) { Item() }
.height(.fractionalWidth(0.3))
.width(.fractionalWidth(0.3))
.interItemSpacing(.fixed(8))
}
.interGroupSpacing(8)
.contentInsets(horizontal: 16, vertical: 8)
.orthogonalScrollingBehavior(.continuous)
.supplementariesFollowContentInsets(false)
.boundarySupplementaryItems {
BoundarySupplementaryItem(elementKind: UICollectionView.elementKindSectionHeader)
.height(.absolute(30))
.alignment(.top)
.pinToVisibleBounds(true)
}
}
}
}