Add code to restore the state of previously expanded folders when accounts are collapsed and expanded.

This commit is contained in:
Maurice Parker 2019-04-18 14:06:22 -05:00
parent 1bec890875
commit 1e23ead8c6
1 changed files with 14 additions and 4 deletions

View File

@ -604,10 +604,20 @@ private extension MasterViewController {
animatingChanges = true animatingChanges = true
var indexPathsToInsert = [IndexPath]() var indexPathsToInsert = [IndexPath]()
for i in 0..<expandNode.childNodes.count { var i = 0
if let child = expandNode.childAtIndex(i) {
func addNode(_ node: Node) {
indexPathsToInsert.append(IndexPath(row: i, section: section)) indexPathsToInsert.append(IndexPath(row: i, section: section))
shadowTable[section].insert(child, at: i) shadowTable[section].insert(node, at: i)
i = i + 1
}
for child in expandNode.childNodes {
addNode(child)
if expandedNodes.contains(child) {
for gChild in child.childNodes {
addNode(gChild)
}
} }
} }