Add code to restore the state of previously expanded folders when accounts are collapsed and expanded.
This commit is contained in:
parent
1bec890875
commit
1e23ead8c6
|
@ -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) {
|
|
||||||
indexPathsToInsert.append(IndexPath(row: i, section: section))
|
func addNode(_ node: Node) {
|
||||||
shadowTable[section].insert(child, at: i)
|
indexPathsToInsert.append(IndexPath(row: i, section: section))
|
||||||
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue