Type Property 型プロパティ

automatic

The default menu style, based on the menu’s context. 省略時のメニュースタイル、メニューのもつ内容に基づきます。

Declaration 宣言

static var automatic: DefaultMenuStyle { get }
Available when Self is DefaultMenuStyle.

Discussion 議論

The default menu style can vary by platform. By default, macOS uses the bordered button style.

If you create a menu inside a container, the style resolves to the recommended style for menus inside that container for that specific platform. For example, a menu nested within another menu will resolve to a submenu:


Menu("Edit") {
    Menu("Arrange") {
        Button("Bring to Front", action: moveSelectionToFront)
        Button("Send to Back", action: moveSelectionToBack)
    }
    Button("Delete", action: deleteSelection)
}

You can override a menu’s style. To apply the default style to a menu, or to a view that contains a menu, use the menuStyle(_:) modifier.