Skip to content

Commit 9c867c8

Browse files
Clean code
1 parent a4d1855 commit 9c867c8

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

BBSwiftUIKit/BBSwiftUIKit/BBScrollView.swift

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,34 +90,21 @@ public struct BBScrollView<Content: View>: UIViewRepresentable, BBUIScrollViewRe
9090
public let axis: Axis.Set
9191
@Binding public var contentOffset: CGPoint
9292
@Binding public var contentOffsetToScrollAnimated: CGPoint?
93-
public var isPagingEnabled: Bool
94-
public var bounces: Bool
95-
public var alwaysBounceVertical: Bool
96-
public var alwaysBounceHorizontal: Bool
97-
public var showsVerticalScrollIndicator: Bool
98-
public var showsHorizontalScrollIndicator: Bool
93+
public var isPagingEnabled: Bool = false
94+
public var bounces: Bool = true
95+
public var alwaysBounceVertical: Bool = false
96+
public var alwaysBounceHorizontal: Bool = false
97+
public var showsVerticalScrollIndicator: Bool = true
98+
public var showsHorizontalScrollIndicator: Bool = true
9999
public let content: () -> Content
100100

101101
public init(_ axis: Axis.Set,
102102
contentOffset: Binding<CGPoint> = .constant(.bb_invalidContentOffset),
103-
contentOffsetToScrollAnimated: Binding<CGPoint?> = .constant(nil),
104-
isPagingEnabled: Bool = false,
105-
bounces: Bool = true,
106-
alwaysBounceVertical: Bool = false,
107-
alwaysBounceHorizontal: Bool = false,
108-
showsVerticalScrollIndicator: Bool = true,
109-
showsHorizontalScrollIndicator: Bool = true,
110103
@ViewBuilder content: @escaping () -> Content)
111104
{
112105
self.axis = axis
113106
self._contentOffset = contentOffset
114-
self._contentOffsetToScrollAnimated = contentOffsetToScrollAnimated
115-
self.isPagingEnabled = isPagingEnabled
116-
self.bounces = bounces
117-
self.alwaysBounceVertical = alwaysBounceVertical
118-
self.alwaysBounceHorizontal = alwaysBounceHorizontal
119-
self.showsVerticalScrollIndicator = showsVerticalScrollIndicator
120-
self.showsHorizontalScrollIndicator = showsHorizontalScrollIndicator
107+
self._contentOffsetToScrollAnimated = .constant(nil)
121108
self.content = content
122109
}
123110

0 commit comments

Comments
 (0)