Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func hierarchySize(hierarchy: Hierarchy<String>) -> CGSize {
- let firstSize = textSize(hierarchy.value)
- var maxWidth = firstSize.width
- var sumOfHeights = firstSize.height
- for child in hierarchy.children {
- let childSize = hierarchySize(hierarchy: child)
- maxWidth = max(maxWidth, indentSize + childSize.width)
- sumOfHeights += rowSpacing + childSize.height
- }
- return CGSize(width: maxWidth, height: sumOfHeights)
- }
Add Comment
Please, Sign In to add comment