Add static function for an empty header bar

This commit is contained in:
david-swift 2023-09-24 13:43:26 +02:00
parent 0351e67493
commit 81426e2e0c
2 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,11 @@ Initialize a header bar.
- start: The start content.
- end: The end content.
### `empty()`
Initialize an empty header bar.
- Returns: The header bar.
### `start(start:)`
Initialize a header bar with only views at the start.

View File

@ -29,6 +29,12 @@ public struct HeaderBar: Widget {
self.end = end()
}
/// Initialize an empty header bar.
/// - Returns: The header bar.
public static func empty() -> Self {
.init(start: { }, end: { })
}
/// Initialize a header bar with only views at the start.
/// - Parameter start: The views.
/// - Returns: The header bar.