All for extra ToolbarView init flexibility
This commit is contained in:
parent
6950051bae
commit
e5f483a7a7
1 changed files with 25 additions and 0 deletions
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue