enum MenuBuilder
Swift
@resultBuilder enum MenuBuilder
Builds the rows of a Menu from items, separators and submenus, with
if, if/else and for supported. Items built in a loop get distinct
derived ids even when their titles repeat.
Sources/LavaMenu/Menu.swift:481
Methods
static func buildArray(_ parts: [[MenuContent]]) -> [MenuContent]
A for loop: every iteration's rows, in order.
Sources/LavaMenu/Menu.swift:523
static func buildBlock(_ parts: [MenuContent]...) -> [MenuContent]
Joins the rows of each statement, in order.
Sources/LavaMenu/Menu.swift:503
static func buildEither(first part: [MenuContent]) -> [MenuContent]
The if branch of an if/else.
Sources/LavaMenu/Menu.swift:513
static func buildEither(second part: [MenuContent]) -> [MenuContent]
The else branch of an if/else.
Sources/LavaMenu/Menu.swift:518
static func buildExpression(_ item: MenuItem) -> [MenuContent]
A menu item.
Sources/LavaMenu/Menu.swift:483
static func buildExpression(_: MenuSeparator) -> [MenuContent]
A separator.
Sources/LavaMenu/Menu.swift:488
static func buildExpression(_ menu: Menu) -> [MenuContent]
A submenu.
Sources/LavaMenu/Menu.swift:493
static func buildExpression(_ contents: [MenuContent]) -> [MenuContent]
Rows built elsewhere, spliced in.
Sources/LavaMenu/Menu.swift:498
static func buildLimitedAvailability(_ part: [MenuContent]) -> [MenuContent]
An if #available block: its rows unchanged.
Sources/LavaMenu/Menu.swift:528
static func buildOptional(_ part: [MenuContent]?) -> [MenuContent]
An if without else: its rows, or none.
Sources/LavaMenu/Menu.swift:508