ControlGroup
A container view that displays semantically-related controls in a visually-appropriate manner for the context
Declaration
struct ControlGroup<Content> where Content : ViewMentioned in
Overview
You can provide an optional label to this view that describes its children. This view may be used in different ways depending on the surrounding context. For example, when you place the control group in a toolbar item, SwiftUI uses the label when the group is moved to the toolbar’s overflow menu.
ContentView()
.toolbar(id: "items") {
ToolbarItem(id: "media") {
ControlGroup {
MediaButton()
ChartButton()
GraphButton()
} label: {
Label("Plus", systemImage: "plus")
}
}
}