BlueprintView
is a UIView
subclass that displays a Blueprint element hierarchy.
init(element:)
instantiates a new BlueprintView
with the given element:
let rootElement = Center(
Column { column in
column.layout.horizontalAlignment = .center
column.layout.minimumVerticalSpacing = 12.0
column.add(child: Label(text: "Hello, world!"))
column.add(child: Label(text: "This is a label"))
}
}
let blueprintView = BlueprintView(element: rootElement)
A BlueprintView
instance can be updated after initialization by assigning the .element
property:
blueprintView.element = Label(text: "This is a new element")
Updates can be animated within an animation block:
UIView.animate(withDuration) {
blueprintView.element = Label(text: "This is a new element")
}
See the documentation for ViewDescription
for more information about transitions.