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

@@ -595,19 +595,19 @@ private extension SidebarViewController {
return rowView.view(atColumn: 0) as? SidebarCell
}
func applyToAvailableCells(_ callback: (SidebarCell, Node) -> Void) {
func applyToAvailableCells(_ completion: (SidebarCell, Node) -> Void) {
outlineView.enumerateAvailableRowViews { (rowView: NSTableRowView, row: Int) -> Void in
guard let cell = cellForRowView(rowView), let node = nodeForRow(row) else {
return
}
callback(cell, node)
completion(cell, node)
}
}
func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ callback: (SidebarCell, Node) -> Void) {
func applyToCellsForRepresentedObject(_ representedObject: AnyObject, _ completion: (SidebarCell, Node) -> Void) {
applyToAvailableCells { (cell, node) in
if node.representsSidebarObject(representedObject) {
callback(cell, node)
completion(cell, node)
}
}
}