From e5f483a7a7210b388b66d474cf1854974fbc58c0 Mon Sep 17 00:00:00 2001 From: Brendan Szymanski Date: Wed, 5 Aug 2026 18:46:54 -0400 Subject: [PATCH] All for extra ToolbarView init flexibility --- .../Extensions/ToolbarView+Extras.swift | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Sources/Portico/Extensions/ToolbarView+Extras.swift b/Sources/Portico/Extensions/ToolbarView+Extras.swift index 0328fc4..35f5032 100644 --- a/Sources/Portico/Extensions/ToolbarView+Extras.swift +++ b/Sources/Portico/Extensions/ToolbarView+Extras.swift @@ -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],