mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Rename callback: to completion:
This commit is contained in:
@@ -764,20 +764,20 @@ private extension MasterFeedViewController {
|
||||
applyToCellsForRepresentedObject(representedObject, configure)
|
||||
}
|
||||
|
||||
func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ callback: (MasterFeedTableViewCell, Node) -> Void) {
|
||||
func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ completion: (MasterFeedTableViewCell, Node) -> Void) {
|
||||
applyToAvailableCells { (cell, node) in
|
||||
if node.representedObject === representedObject {
|
||||
callback(cell, node)
|
||||
completion(cell, node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func applyToAvailableCells(_ callback: (MasterFeedTableViewCell, Node) -> Void) {
|
||||
func applyToAvailableCells(_ completion: (MasterFeedTableViewCell, Node) -> Void) {
|
||||
tableView.visibleCells.forEach { cell in
|
||||
guard let indexPath = tableView.indexPath(for: cell), let node = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return
|
||||
}
|
||||
callback(cell as! MasterFeedTableViewCell, node)
|
||||
completion(cell as! MasterFeedTableViewCell, node)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1630,7 +1630,7 @@ private extension SceneCoordinator {
|
||||
|
||||
}
|
||||
|
||||
func fetchUnsortedArticlesAsync(for representedObjects: [Any], callback: @escaping ArticleSetBlock) {
|
||||
func fetchUnsortedArticlesAsync(for representedObjects: [Any], completion: @escaping ArticleSetBlock) {
|
||||
// The callback will *not* be called if the fetch is no longer relevant — that is,
|
||||
// if it’s been superseded by a newer fetch, or the timeline was emptied, etc., it won’t get called.
|
||||
precondition(Thread.isMainThread)
|
||||
@@ -1641,7 +1641,7 @@ private extension SceneCoordinator {
|
||||
guard !operation.isCanceled, let strongSelf = self, operation.id == strongSelf.fetchSerialNumber else {
|
||||
return
|
||||
}
|
||||
callback(articles)
|
||||
completion(articles)
|
||||
}
|
||||
|
||||
fetchRequestQueue.add(fetchOperation)
|
||||
|
||||
Reference in New Issue
Block a user