Skip to content

Commit 2e3365a

Browse files
authored
showsIndicators (#42)
1 parent b751b84 commit 2e3365a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Sources/CollectionView/CollectionViewLayout.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ public enum CollectionViewLayouts {
4141
}
4242

4343
public struct List<Separator: View>: CollectionViewLayoutType {
44+
4445

4546
public let direction: CollectionViewListDirection
4647

48+
public var showsIndicators: Bool = false
49+
4750
public var contentPadding: EdgeInsets
4851

4952
private let separator: Separator
@@ -83,12 +86,19 @@ public enum CollectionViewLayouts {
8386

8487
return self
8588
}
86-
89+
90+
public consuming func showsIndicators(_ showsIndicators: Bool) -> Self {
91+
92+
self.showsIndicators = showsIndicators
93+
94+
return self
95+
}
96+
8797
public func body(content: Content) -> some View {
8898
switch direction {
8999
case .vertical:
90100

91-
ScrollView(.vertical) {
101+
ScrollView(.vertical, showsIndicators: showsIndicators) {
92102

93103
if separator is EmptyView {
94104
LazyVStack {
@@ -114,7 +124,7 @@ public enum CollectionViewLayouts {
114124

115125
case .horizontal:
116126

117-
ScrollView(.horizontal) {
127+
ScrollView(.horizontal, showsIndicators: showsIndicators) {
118128

119129
if separator is EmptyView {
120130
LazyHStack {

0 commit comments

Comments
 (0)