SwiftUI Advent Calendar Open

Dialog Icon

Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms.

Dialog Icon - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 17.0+ iPadOS 17.0+ macOS 13.0+ watchOS 10.0+ tvOS 17.0+

SwiftUI Code

Docs
@State var isShowingDialog = false

var body: some View {
    Button("FooBar") {
        isShowingDialog = true
    }
    .confirmationDialog(
        "Are you sure you want to do FooBar?",
        isPresented: $isShowingDialog
    ) {
        Button("Foo", role: .destructive, action: action)
        Button("Bar", role: .cancel) {
            isShowingDialog = false
        }
    }
    .dialogIcon(Image(.cats))

}

Found an issue or have a suggestion?

Created: December 4, 2026Updated: December 4, 2026

More View Components

View all
Text Tightening - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Text Tightening

Sets whether text in this view can compress the space between characters when necessary to fit text in a line.

Symbol Rendering Mode - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Symbol Rendering Mode

Sets the rendering mode for symbol images within this view.

Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
environment

Toolbar Vertical Edge

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
structure

Hinge State

A type encapsulating the state of a single hinge.

Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Disabled Toolbar Vertical Behavior

Disables the vertical bar.

Explore Other Components

Browse all
Toolbar Title Alignment - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Toolbar Title Alignment

Sets the preferred alignment of the navigation bar’s title. The navigation bar resolves the alignment of its title automatically based on context, and toolbar roles. Use this modifier to override that resolution.

MenuPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

MenuPickerStyle

A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.

Toolbar Overflow Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toolbar Overflow Menu

The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.

ButtonToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

ButtonToggleStyle

A toggle style that displays as a button with its label as the title.

ToolbarItem Shared Background Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ToolbarItem Shared Background Visibility

Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping

Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

Toggle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toggle

Creates a toggle with title, image, systemImage, and custom label.

Remove Toolbar Item Margin - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Remove Toolbar Item Margin

Configures whether the content margins are removed.