This repository was archived by the owner on Dec 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,17 @@ public extension UICollectionView {
1919 public func reload< T: Hashable > (
2020 changes: [ Change < T > ] ,
2121 section: Int = 0 ,
22- completion: @escaping ( Bool ) -> Void ) {
22+ completion: ( ( Bool ) -> Void ) ? = nil ) {
2323
2424 let changesWithIndexPath = IndexPathConverter ( ) . convert ( changes: changes, section: section)
2525
2626 // reloadRows needs to be called outside the batch
2727
2828 performBatchUpdates ( {
2929 internalBatchUpdates ( changesWithIndexPath: changesWithIndexPath)
30- } , completion: completion)
30+ } , completion: { finished in
31+ completion ? ( finished)
32+ } )
3133
3234 changesWithIndexPath. replaces. executeIfPresent {
3335 self . reloadItems ( at: $0)
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public extension UITableView {
2525 insertionAnimation: UITableViewRowAnimation = . automatic,
2626 deletionAnimation: UITableViewRowAnimation = . automatic,
2727 replacementAnimation: UITableViewRowAnimation = . automatic,
28- completion: @escaping ( Bool ) -> Void ) {
28+ completion: ( ( Bool ) -> Void ) ? = nil ) {
2929
3030 let changesWithIndexPath = IndexPathConverter ( ) . convert ( changes: changes, section: section)
3131
@@ -36,7 +36,9 @@ public extension UITableView {
3636 internalBatchUpdates ( changesWithIndexPath: changesWithIndexPath,
3737 insertionAnimation: insertionAnimation,
3838 deletionAnimation: deletionAnimation)
39- } , completion: completion)
39+ } , completion: { finished in
40+ completion ? ( finished)
41+ } )
4042
4143 changesWithIndexPath. replaces. executeIfPresent {
4244 self . reloadRows ( at: $0, with: replacementAnimation)
@@ -52,7 +54,7 @@ public extension UITableView {
5254 reloadRows ( at: $0, with: replacementAnimation)
5355 }
5456
55- completion ( true )
57+ completion ? ( true )
5658 }
5759 }
5860
You can’t perform that action at this time.
0 commit comments