Added initial POC version of NetNewsWire for iOS to use as a starting point for the actual app.

This commit is contained in:
Maurice Parker
2019-04-15 15:03:05 -05:00
parent 8f1f153e98
commit 8526db8b4c
47 changed files with 4454 additions and 220 deletions

View File

@@ -0,0 +1,40 @@
//Copyright © 2019 Vincode, Inc. All rights reserved.
import Foundation
import Account
import RSCore
import RSTree
struct AddFeedFolderPickerData {
var containerNames = [String]()
var containers = [Container]()
init() {
let treeControllerDelegate = FolderTreeControllerDelegate()
let rootNode = Node(representedObject: AccountManager.shared.localAccount, parent: nil)
rootNode.canHaveChildNodes = true
let treeController = TreeController(delegate: treeControllerDelegate, rootNode: rootNode)
guard let rootNameProvider = treeController.rootNode.representedObject as? DisplayNameProvider else {
return
}
let rootName = rootNameProvider.nameForDisplay
containerNames.append(rootName)
containers.append(treeController.rootNode.representedObject as! Container)
treeController.rootNode.childNodes.forEach { node in
guard let childContainer = node.representedObject as? Container else {
return
}
let childName = (childContainer as! DisplayNameProvider).nameForDisplay
containerNames.append("\(rootName) / \(childName)")
containers.append(childContainer)
}
}
}