forked from aparoksha/adwaita-swift
Improve view builder function for optionals
This commit is contained in:
parent
279219ea6c
commit
b00b743034
@ -58,14 +58,15 @@ public enum ViewBuilder {
|
|||||||
/// - Returns: A nonoptional component.
|
/// - Returns: A nonoptional component.
|
||||||
public static func buildOptional(_ component: Component?) -> Component {
|
public static func buildOptional(_ component: Component?) -> Component {
|
||||||
.element(
|
.element(
|
||||||
VStack {
|
Bin()
|
||||||
if let component {
|
.child {
|
||||||
buildFinalResult(component)
|
if let component {
|
||||||
} else {
|
buildFinalResult(component)
|
||||||
[]
|
} else {
|
||||||
|
[]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
.visible(component != nil)
|
||||||
.visible(component != nil)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user