@@ -97,63 +97,31 @@ public struct BBTableView<Data, Content>: UIViewControllerRepresentable, BBUIScr
9797 @Binding public var scrollToRow : BBTableViewScrollToRowParameter ?
9898 @Binding public var contentOffset : CGPoint
9999 @Binding public var contentOffsetToScrollAnimated : CGPoint ?
100- public var isPagingEnabled : Bool
101- public var bounces : Bool
102- public var alwaysBounceVertical : Bool
103- public var alwaysBounceHorizontal : Bool
104- public var showsVerticalScrollIndicator : Bool
105- public var showsHorizontalScrollIndicator : Bool
100+ public var isPagingEnabled : Bool = false
101+ public var bounces : Bool = true
102+ public var alwaysBounceVertical : Bool = false
103+ public var alwaysBounceHorizontal : Bool = false
104+ public var showsVerticalScrollIndicator : Bool = true
105+ public var showsHorizontalScrollIndicator : Bool = true
106106
107107 @Binding public var isRefreshing : Bool
108108 public var setupRefreshControl : ( ( UIRefreshControl ) -> Void ) ?
109109 public var pullDownToRefresh : ( ( ) -> Void ) ?
110- public var bottomSpaceForLoadingMore : CGFloat
110+ public var bottomSpaceForLoadingMore : CGFloat = . bb_invalidBottomSpaceForLoadingMore
111111 public var pullUpToLoadMore : ( ( ) -> Void ) ?
112112
113113 public var setupTableView : ( ( UITableView ) -> Void ) ?
114114 public var updateTableView : ( ( UITableView ) -> Void ) ?
115115
116- public init ( _ data: Data ,
117- reloadData: Binding < Bool > = . constant( false ) ,
118- reloadRows: Binding < [ Int ] > = . constant( [ ] ) ,
119- scrollToRow: Binding < BBTableViewScrollToRowParameter ? > = . constant( nil ) ,
120- contentOffset: Binding < CGPoint > = . constant( . bb_invalidContentOffset) ,
121- contentOffsetToScrollAnimated: Binding < CGPoint ? > = . constant( nil ) ,
122- isPagingEnabled: Bool = false ,
123- bounces: Bool = true ,
124- alwaysBounceVertical: Bool = false ,
125- alwaysBounceHorizontal: Bool = false ,
126- showsVerticalScrollIndicator: Bool = true ,
127- showsHorizontalScrollIndicator: Bool = true ,
128- isRefreshing: Binding < Bool > = . constant( false ) ,
129- setupRefreshControl: ( ( UIRefreshControl ) -> Void ) ? = nil ,
130- pullDownToRefresh: ( ( ) -> Void ) ? = nil ,
131- bottomSpaceForLoadingMore: CGFloat = . bb_invalidBottomSpaceForLoadingMore,
132- pullUpToLoadMore: ( ( ) -> Void ) ? = nil ,
133- setupTableView: ( ( UITableView ) -> Void ) ? = nil ,
134- updateTableView: ( ( UITableView ) -> Void ) ? = nil ,
135- @ViewBuilder content: @escaping ( Data . Element ) -> Content )
136- {
116+ public init ( _ data: Data , @ViewBuilder content: @escaping ( Data . Element ) -> Content ) {
137117 self . data = data
138118 self . content = content
139- self . _reloadData = reloadData
140- self . _reloadRows = reloadRows
141- self . _scrollToRow = scrollToRow
142- self . _contentOffset = contentOffset
143- self . _contentOffsetToScrollAnimated = contentOffsetToScrollAnimated
144- self . isPagingEnabled = isPagingEnabled
145- self . bounces = bounces
146- self . alwaysBounceVertical = alwaysBounceVertical
147- self . alwaysBounceHorizontal = alwaysBounceHorizontal
148- self . showsVerticalScrollIndicator = showsVerticalScrollIndicator
149- self . showsHorizontalScrollIndicator = showsHorizontalScrollIndicator
150- self . _isRefreshing = isRefreshing
151- self . setupRefreshControl = setupRefreshControl
152- self . pullDownToRefresh = pullDownToRefresh
153- self . bottomSpaceForLoadingMore = bottomSpaceForLoadingMore
154- self . pullUpToLoadMore = pullUpToLoadMore
155- self . setupTableView = setupTableView
156- self . updateTableView = updateTableView
119+ self . _reloadData = . constant( false )
120+ self . _reloadRows = . constant( [ ] )
121+ self . _scrollToRow = . constant( nil )
122+ self . _contentOffset = . constant( . bb_invalidContentOffset)
123+ self . _contentOffsetToScrollAnimated = . constant( nil )
124+ self . _isRefreshing = . constant( false )
157125 }
158126
159127 public func makeUIViewController( context: Context ) -> UIViewController {
0 commit comments