mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Merge pull request #4960 from stuartbreckenridge/main
🩹 Use completion handler in collection view.
This commit is contained in:
1 file changed
+9
-9
@@ -446,7 +446,7 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
|
||||
completion?()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
collectionView.performBatchUpdates {
|
||||
if let deletes = changes.deletes, !deletes.isEmpty {
|
||||
collectionView.deleteSections(IndexSet(deletes))
|
||||
@@ -479,17 +479,17 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let rowChanges = changes.rowChanges {
|
||||
for rowChange in rowChanges {
|
||||
if let reloads = rowChange.reloadIndexPaths, !reloads.isEmpty {
|
||||
collectionView.reloadItems(at: reloads)
|
||||
} completion: { finished in
|
||||
if let rowChanges = changes.rowChanges {
|
||||
for rowChange in rowChanges {
|
||||
if let reloads = rowChange.reloadIndexPaths, !reloads.isEmpty {
|
||||
self.collectionView.reloadItems(at: reloads)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
completion?()
|
||||
completion?()
|
||||
}
|
||||
}
|
||||
|
||||
func applyToAvailableCells(_ completion: (MainFeedCollectionViewCell, IndexPath) -> Void) {
|
||||
|
||||
Reference in new issue
Block a user