Rename expand and collapse functions to be more descriptive

This commit is contained in:
Maurice Parker 2019-09-05 16:08:57 -05:00
parent 953259f0d3
commit 734ce4bc67
2 changed files with 12 additions and 12 deletions

View File

@ -361,11 +361,11 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
if coordinator.isExpanded(sectionNode) {
headerView.disclosureExpanded = false
coordinator.collapse(section: sectionIndex)
coordinator.collapseSection(sectionIndex)
self.applyChanges(animate: true)
} else {
headerView.disclosureExpanded = true
coordinator.expand(section: sectionIndex)
coordinator.expandSection(sectionIndex)
self.applyChanges(animate: true)
}
@ -406,14 +406,14 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
@objc func expandSelectedRows(_ sender: Any?) {
if let indexPath = coordinator.currentFeedIndexPath {
coordinator.expand(indexPath)
coordinator.expandFolder(indexPath)
self.applyChanges(animate: true)
}
}
@objc func collapseSelectedRows(_ sender: Any?) {
if let indexPath = coordinator.currentFeedIndexPath {
coordinator.collapse(indexPath)
coordinator.collapseFolder(indexPath)
self.applyChanges(animate: true)
}
}
@ -447,7 +447,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
if !coordinator.isExpanded(sectionNode) {
coordinator.expand(section: sectionIndex)
coordinator.expandSection(sectionIndex)
self.applyChanges(animate: true) {
completion?()
}
@ -473,7 +473,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
return
}
coordinator.expand(indexPath)
coordinator.expandFolder(indexPath)
reloadNode(parent)
self.applyChanges(animate: true) { [weak self] in
@ -631,7 +631,7 @@ private extension MasterFeedViewController {
guard let indexPath = tableView.indexPath(for: cell) else {
return
}
coordinator.expand(indexPath)
coordinator.expandFolder(indexPath)
self.applyChanges(animate: true)
}
@ -639,7 +639,7 @@ private extension MasterFeedViewController {
guard let indexPath = tableView.indexPath(for: cell) else {
return
}
coordinator.collapse(indexPath)
coordinator.collapseFolder(indexPath)
self.applyChanges(animate: true)
}

View File

@ -436,7 +436,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
return 0
}
func expand(section: Int) {
func expandSection(_ section: Int) {
guard let expandNode = treeController.rootNode.childAtIndex(section) else {
return
}
@ -463,7 +463,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
animatingChanges = false
}
func expand(_ indexPath: IndexPath) {
func expandFolder(_ indexPath: IndexPath) {
let expandNode = shadowTable[indexPath.section][indexPath.row]
guard !expandedNodes.contains(expandNode) else { return }
expandedNodes.append(expandNode)
@ -480,7 +480,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
animatingChanges = false
}
func collapse(section: Int) {
func collapseSection(_ section: Int) {
animatingChanges = true
guard let collapseNode = treeController.rootNode.childAtIndex(section) else {
@ -496,7 +496,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
animatingChanges = false
}
func collapse(_ indexPath: IndexPath) {
func collapseFolder(_ indexPath: IndexPath) {
animatingChanges = true
let collapseNode = shadowTable[indexPath.section][indexPath.row]