From 734ce4bc67ac3e3ef6c65e78d736d8429bd41822 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 5 Sep 2019 16:08:57 -0500 Subject: [PATCH] Rename expand and collapse functions to be more descriptive --- iOS/MasterFeed/MasterFeedViewController.swift | 16 ++++++++-------- iOS/SceneCoordinator.swift | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 048dfb94a..b80dbe217 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -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) } diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 57ca14d14..70c418056 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -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]