Contents

init(_:image:content:)

Creates a menu bar extra with an image to use as the items label. The provided title will be used by the accessibility system.

Declaration

nonisolated init(_ titleKey: LocalizedStringKey, image: ImageResource, @ViewBuilder content: () -> Content)

Parameters

  • titleKey:

    The localized string key to use for the accessibility label of the item.

  • image:

    The image resource to use as the label.

  • content:

    A View to display when the user selects the item.

Discussion

The item defines the primary scene of an App.

When this item is removed from the system menu bar by the user, the application will be automatically quit. As such, it should not be used in conjunction with other scene types in your App.

See Also

Creating a menu bar extra with an image