1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-11 01:42:35 +03:00
Macaw/Source/views/NodesMap.swift

26 lines
394 B
Swift
Raw Normal View History

2016-08-24 13:25:14 +03:00
import UIKit
let nodesMap = NodesMap()
class NodesMap {
var map = [Node: MacawView]()
func add(node: Node, view: MacawView) {
map[node] = view
if let group = node as? Group {
group.contents.forEach { child in
self.add(child, view: view)
}
}
}
func getView(node: Node) -> MacawView? {
return map[node]
}
func remove(node: Node) {
map.removeValueForKey(node)
}
}