All for extra ToolbarView init flexibility

This commit is contained in:
Brendan Szymanski 2026-08-05 18:46:54 -04:00
parent 6950051bae
commit e5f483a7a7

View file

@ -12,6 +12,31 @@ extension ToolbarView {
/// - content: A closure producing the content widget.
/// - top: A closure producing widgets to add as top bars.
/// - bottom: A closure producing widgets to add as bottom bars.
public init(
@ViewBuilder content: () -> [AnyView],
@ViewBuilder top: () -> [AnyView]
) {
self.init(content: content, top: top, bottom: { })
}
/// Creates a toolbar view with content and bottom bars.
///
/// - Parameters:
/// - content: A closure producing the content widget.
/// - bottom: A closure producing widgets to add as bottom bars.
public init(
@ViewBuilder content: () -> [AnyView],
@ViewBuilder bottom: () -> [AnyView]
) {
self.init(content: content, top: { }, bottom: bottom)
}
/// Creates a toolbar view with content, top bars, and bottom bars.
///
/// - Parameters:
/// - content: A closure producing the content widget.
/// - top: A closure producing widgets to add as top bars.
/// - bottom: A closure producing widgets to add as bottom bars.
public init(
@ViewBuilder content: () -> [AnyView],
@ViewBuilder top: () -> [AnyView],