Rename callback: to completion:

This commit is contained in:
Maurice Parker
2019-12-14 18:01:34 -07:00
parent 43bf65b7a6
commit 58b24f3349
26 changed files with 196 additions and 196 deletions

View File

@@ -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)
}
}

View File

@@ -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 its been superseded by a newer fetch, or the timeline was emptied, etc., it wont 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)