I am displaying a floor plan which is always the same. Everytime I make a change I just parse the same floor view svg into a Group
floorLayout = try SVGParser.parse(text: floor.birdsEyeViewSvg) as? Group
and apply the proper styling as follows:
switch tag {
case .background:
guard let shape = node as? Shape else { continue }
shape.fill = backgroundColor
let borderWidth: Double = UIScreen.main.sizeType == .iPad1366 ? 1.5 : 2
shape.stroke = Stroke(fill: stateColor, width: borderWidth)
case .name:
guard let text = node as? Text else { continue }
if let tableOwner = tableOwner {
text.text = "\(text.text)\n\(tableOwner.initials)"
text.baseline = .alphabetic
} else {
text.baseline = .mid
}
let fontSize = UIScreen.main.sizeType == .iPad1366 ? 8 : 10
let systemFont = Font(name: "SF UI Display",
size: fontSize,
weight: "regular")
text.font = systemFont
text.fill = isNameHidden ? Color.clear : Color(val: UIColor.gray1Color().hex)
text.align = .mid
case .alert:
guard let image = node as? Image else { continue }
image.src = isAlertHidden ? "hidden" : "icon.alert.red"
}
and then I set to MacawView.node. However when we set a new node, we don't see memory getting release. Inside the profiler I found an extended amount of memory leaks, which I have taken screenshots off.
I am displaying a floor plan which is always the same. Everytime I make a change I just parse the same floor view svg into a Group
floorLayout = try SVGParser.parse(text: floor.birdsEyeViewSvg) as? Group
and apply the proper styling as follows:
and then I set to
MacawView.node
. However when we set a new node, we don't see memory getting release. Inside the profiler I found an extended amount of memory leaks, which I have taken screenshots off.