@@ -19,9 +19,10 @@ public extension BBTableView {
1919 return view
2020 }
2121
22- func bb_reloadRows( _ reloadRows : Binding < [ Int ] > ) -> Self {
22+ func bb_reloadRows( _ rows : Binding < [ Int ] > , animation : UITableView . RowAnimation ) -> Self {
2323 var view = self
24- view. _reloadRows = reloadRows
24+ view. _reloadRows = rows
25+ view. reloadRowsAnimation = animation
2526 return view
2627 }
2728
@@ -83,7 +84,9 @@ public struct BBTableView<Data, Content>: UIViewControllerRepresentable, BBUIScr
8384 let content : ( Data . Element ) -> Content
8485
8586 @Binding public var reloadData : Bool
87+
8688 @Binding public var reloadRows : [ Int ]
89+ public var reloadRowsAnimation : UITableView . RowAnimation = . automatic
8790
8891 @Binding public var scrollToRow : Int ?
8992 public var scrollToRowPosition : UITableView . ScrollPosition = . none
@@ -204,7 +207,7 @@ private class _BBTableViewController<Data, Content>: UIViewController, UITableVi
204207 }
205208
206209 if !representable. reloadRows. isEmpty {
207- tableView. reloadRows ( at: representable. reloadRows. map { IndexPath ( row: $0, section: 0 ) } , with: . automatic )
210+ tableView. reloadRows ( at: representable. reloadRows. map { IndexPath ( row: $0, section: 0 ) } , with: representable . reloadRowsAnimation )
208211
209212 DispatchQueue . main. async { [ weak self] in
210213 guard let self = self else { return }
0 commit comments