MacKuba

🍎 Kuba Suder's blog on Mac & iOS development

SwiftUI Index

Filter: | Search:

Note: Catalyst version tag is only shown if the availability differs from iOS.

SwiftUI 5.0 (2023) iOS 17|macOS 14|watchOS 10|tvOS 17|xrOS 1

Added in Beta 2

  • DefaultSubscriptionStoreMarketingContent StoreKit xrOS

    A view that represents the default marketing content for an in-app subscription store.

  • GeometryReader3D xrOS

    A container view that defines its content as a function of its own size and coordinate space.

  • ImmersiveSpace xrOS

    A scene that presents its content in an unbounded space.

  • UIHostingOrnament xrOS

    A model that represents an ornament suitable for being hosted in UIKit.

  • UIOrnament xrOS

    The abstract base class that represents an ornament. You don’t create an instance of this class directly. Instead use UIHostingOrnament.

  • ViewAttachmentEntity RealityKit xrOS

    An entity that has a view attachment.

  • .glassBackgroundEffect() xrOS

    Sets the view’s glass background to displayMode, filling the view’s container relative rounded corner shape.

  • .immersionStyle() xrOS

    Sets the allowed styles for the immersive space.

  • .listRowHoverEffect() xrOS

    Requests that the containing list row use the provided hover effect.

  • .listRowHoverEffectDisabled() xrOS

    Requests that the containing list row have its hover effect disabled.

  • .ornament() xrOS

    Presents an ornament.

  • .padding3D() xrOS

    Pads this view using the edge insets you specify.

  • .perspectiveRotationEffect() xrOS

    Rotates this view’s rendered output in three dimensions around the given axis of rotation.

  • .preferredSurroundingsEffect() xrOS

    Sets the preference for the video passthrough effect of the user’s surroundings. Use nil to state no preference. Note that this modifier only sets a preference and ultimately the system will decide if it will honor it or not.

  • .transform3DEffect() xrOS

    Applies a 3D transformation to the receiver.

  • .visualEffect3D() xrOS

    Applies effects to this view, while providing access to layout information via GeometryProxy3D.

  • \.accessibilityPrefersCameraAnchorAlternative xrOS

    Whether the system setting to prefer alternatives to camera-anchored content is on.

  • \.dismissImmersiveSpace xrOS

    An immersive space dismissal action stored in a view’s environment.

  • \.openImmersiveSpace xrOS

    An action that presents an immersive space.

  • \.physicalMetrics xrOS

    The physical metrics associated with a scene.

  • @PhysicalMetric xrOS

    Provides access to a value in points that corresponds to the specified physical measurement.

Added in Beta 1 (backported to earlier versions)

  • UnevenRoundedRectangle iOS macOS watchOS tvOS

    A rectangular shape with rounded corners with different values, aligned inside the frame of the view containing it.

  • .accessibilityZoomAction() iOS macOS watchOS tvOS

    Adds an accessibility zoom action to the view. Actions allow assistive technologies, such as VoiceOver, to interact with the view by invoking the action.

  • .dialogIcon() macOS watchOS

    Configures the icon used by dialogs within this view.

  • .dialogSeverity() macOS watchOS

  • .listRowSpacing() iOS

    Sets the vertical spacing between two adjacent rows in a List.

  • .typeSelectEquivalent() iOS macOS watchOS tvOS

    Sets an explicit type select equivalent text in a collection, such as a list or table.

  • \.horizontalSizeClass iOS macOS watchOS tvOS

    The horizontal size class of this environment.

  • \.isActivityFullscreen WidgetKit iOS

    A Boolean value that indicates whether the Live Activity appears in a full-screen presentation.

  • \.showsWidgetContainerBackground WidgetKit iOS macOS watchOS

    An environment variable that indicates whether the background of a widget appears.

  • \.sidebarRowSize iOS macOS watchOS tvOS

    The current size of sidebar rows.

  • \.verticalSizeClass iOS macOS watchOS tvOS

    The vertical size class of this environment.

Views SwiftUI 5.0  –  2023

  • ContentUnavailableView iOS macOS watchOS tvOS xrOS

    An interface, consisting of a label and additional content, that you display when the content of your app is unavailable to users.

  • ControlGroup iOS macOS tvOS xrOS

    A container view that displays semantically-related controls in a visually-appropriate manner for the context

  • DatePicker iOS macOS watchOS xrOS

    A control for selecting an absolute date.

  • DefaultSubscriptionStoreMarketingContent StoreKit xrOS

    A view that represents the default marketing content for an in-app subscription store.

  • FillShapeView iOS macOS watchOS tvOS xrOS

    A shape provider that fills its shape.

  • GeometryReader3D xrOS

    A container view that defines its content as a function of its own size and coordinate space.

  • HelpLink macOS xrOS

    A button with a standard appearance that opens app-specific help documentation.

  • KeyframeAnimator iOS macOS watchOS tvOS xrOS

    A container that animates its content with keyframes.

  • MapCompass MapKit iOS macOS watchOS tvOS xrOS

    A view that reflects the current orientation of the associated map.

  • MapContentView MapKit iOS macOS watchOS tvOS xrOS

    A view that contains content that displays on a map at a specific position, and that responds to specific interactions you specify.

  • MapPitchButton MapKit iOS macOS tvOS xrOS

    A button that sets the pitch (viewing angle) of an associated map to a viewable angle if flat, or returns the map to flat if pitched.

  • MapPitchSlider MapKit macOS Catalyst

    A slider control that allows a person to change the pitch of the map.

  • MapScaleView MapKit iOS macOS tvOS xrOS

    Displays a legend with distance information for the associated map.

  • MapUserLocationButton MapKit iOS macOS watchOS tvOS xrOS

    A button that sets the framing of the associated map to the user location.

  • MapZoomStepper MapKit macOS Catalyst

    Buttons a person uses to adjust the zoom level of the map.

  • Menu iOS macOS tvOS xrOS

    A control for presenting a menu of actions.

  • PayLaterView PassKit iOS xrOS

    A view that displays the Apple Pay Later visual merchandising widget.

  • PhaseAnimator iOS macOS watchOS tvOS xrOS

    A container that animates its content by automatically cycling through a collection of phases that you provide, each defining a discrete step within an animation.

  • ProductView StoreKit iOS macOS watchOS tvOS xrOS

    A view that merchandises an individual in-app purchase product.

  • SettingsLink macOS

    A view that opens the Settings scene defined by an app.

  • StoreView StoreKit iOS macOS watchOS tvOS xrOS

    A view that merchandises a collection of in-app purchase products.

  • SubscriptionStoreView StoreKit iOS macOS watchOS tvOS xrOS

    A view that merchandises a collection of auto-renewable subscription options in a subscription group.

Scenes SwiftUI 5.0  –  2023

  • ImmersiveSpace xrOS

    A scene that presents its content in an unbounded space.

Commands SwiftUI 5.0  –  2023

Classes SwiftUI 5.0  –  2023

  • UIHostingOrnament xrOS

    A model that represents an ornament suitable for being hosted in UIKit.

  • UIOrnament xrOS

    The abstract base class that represents an ornament. You don’t create an instance of this class directly. Instead use UIHostingOrnament.

  • ViewAttachmentEntity RealityKit xrOS

    An entity that has a view attachment.

View Modifiers SwiftUI 5.0  –  2023

  • .accessibilityDirectTouch() iOS macOS watchOS tvOS xrOS

    Explicitly set whether this accessibility element is a direct touch area. Direct touch areas passthrough touch events to the app rather than being handled through an assistive technology, such as VoiceOver. The modifier accepts an optional AccessibilityDirectTouchOptions option set to customize the functionality of the direct touch area.

  • .allowedDynamicRange() iOS macOS tvOS xrOS

    Returns a new view configured with the specified allowed dynamic range.

  • .alternatingRowBackgrounds() macOS

    Overrides whether lists and tables in this view have alternating row backgrounds.

  • .badgeProminence() iOS macOS xrOS

    Specifies the prominence of badges created by this view.

  • .buttonRepeatBehavior() iOS macOS watchOS tvOS xrOS

    Sets whether buttons in this view should repeatedly trigger their actions on prolonged interactions.

  • .chartAngleSelection() Charts iOS macOS watchOS tvOS xrOS

  • .chartGesture() Charts iOS macOS watchOS tvOS xrOS

  • .chartScrollableAxes() Charts iOS macOS watchOS tvOS xrOS

    Configures the scrollable behavior of charts in this view.

  • .chartScrollPosition() Charts iOS macOS watchOS tvOS xrOS

    Associates a binding to be updated when the chart scrolls along the x-axis.

  • .chartScrollTargetBehavior() Charts iOS macOS watchOS tvOS xrOS

    Sets the scroll behavior of the scrollable chart.

  • .chartXAxisStyle() Charts iOS macOS watchOS tvOS xrOS

    Configures the x axis content of charts.

  • .chartXSelection() Charts iOS macOS watchOS tvOS xrOS

  • .chartXVisibleDomain() Charts iOS macOS watchOS tvOS xrOS

    Sets the length of the visible domain in the X dimension.

  • .chartYAxisStyle() Charts iOS macOS watchOS tvOS xrOS

    Configures the y axis content of charts.

  • .chartYSelection() Charts iOS macOS watchOS tvOS xrOS

  • .chartYVisibleDomain() Charts iOS macOS watchOS tvOS xrOS

    Sets the length of the visible domain in the Y dimension.

  • .colorEffect() iOS macOS tvOS xrOS

    Returns a new view that applies shader to self as a filter effect on the color of each pixel.

  • .containerBackground() iOS macOS watchOS tvOS xrOS

    Sets the container background of the enclosing container using a view.

  • .containerRelativeFrame() iOS macOS watchOS tvOS xrOS

    Positions this view within an invisible frame with a size relative to the nearest container.

  • .contentMargins() iOS macOS watchOS tvOS xrOS

    Configures the content margin for a provided placement.

  • .controlGroupStyle() iOS macOS tvOS xrOS

    Sets the style for control groups within this view.

  • .currentEntitlementTask() StoreKit iOS macOS watchOS tvOS xrOS

    Declares the view as dependent on the entitlement of an in-app purchase product for productID and returns a modified view.

  • .datePickerStyle() iOS macOS watchOS xrOS

    Sets the style for date pickers within this view.

  • .defaultFocus() macOS watchOS tvOS iOS xrOS

    Defines a region of the window in which default focus is evaluated by assigning a value to a given focus state binding.

  • .defaultHoverEffect() iOS tvOS xrOS

    Sets the default hover effect to use for views within this view.

  • .dialogIcon() macOS watchOS xrOS

    Configures the icon used by dialogs within this view.

  • .dialogSeverity() macOS watchOS xrOS

  • .dialogSuppression() iOS macOS watchOS tvOS xrOS

    Enables user suppression of dialogs and alerts presented within self, with a custom suppression message on macOS. Unused on other platforms.

  • .dialogSuppressionToggle() iOS macOS watchOS tvOS xrOS

    Enables user suppression of dialogs and alerts presented within self, with a default suppression message on macOS. Unused on other platforms.

  • .distortionEffect() iOS macOS tvOS xrOS

    Returns a new view that applies shader to self as a geometric distortion effect on the location of each pixel.

  • .fileDialogBrowserOptions() iOS macOS xrOS

    On macOS, configures the fileExporter, fileImporter, or fileMover to provide a refined URL search experience: include or exclude hidden files, allow searching by tag, etc.

  • .fileDialogConfirmationLabel() iOS macOS xrOS

    On macOS, configures the the fileExporter, fileImporter, or fileMover with a custom confirmation button label.

  • .fileDialogCustomizationID() iOS macOS xrOS

    On macOS, configures the fileExporter, fileImporter, or fileMover to persist and restore the file dialog configuration.

  • .fileDialogDefaultDirectory() iOS macOS xrOS

    Configures the fileExporter, fileImporter, or fileMover to open with the specified default directory.

  • .fileDialogImportsUnresolvedAliases() iOS macOS xrOS

    On macOS, configures the fileExporter, fileImporter, or fileMover behavior when a user chooses an alias.

  • .fileDialogMessage() iOS macOS xrOS

    On macOS, configures the the fileExporter, fileImporter, or fileMover with a custom text that is presented to the user, similar to a title.

  • .fileDialogURLEnabled() iOS macOS xrOS

    On macOS, configures the the fileImporter or fileMover to conditionally disable presented URLs.

  • .fileExporterFilenameLabel() iOS macOS xrOS

    On macOS, configures the fileExporter with a label for the file name field.

  • .focusable() macOS watchOS tvOS iOS xrOS

    Specifies if the view is focusable.

  • .focusEffectDisabled() iOS macOS watchOS tvOS xrOS

    Adds a condition that controls whether this view can display focus effects, such as a default focus ring or hover effect.

  • .glassBackgroundEffect() xrOS

    Sets the view’s glass background to displayMode, filling the view’s container relative rounded corner shape.

  • .healthDataAccessRequest() HealthKit iOS xrOS

    Requests authorization to read and share the given HealthKit types.

  • .hoverEffectDisabled() iOS tvOS xrOS

    Adds a condition that controls whether this view can display hover effects.

  • .inAppPurchaseOptions() StoreKit iOS macOS watchOS tvOS xrOS

    Add a function to call before initiating a purchase from an in-app store within view, providing a set of options for the purchase.

  • .inspector() iOS macOS

    Inserts an inspector at the applied position in the view hierarchy.

  • .inspectorColumnWidth() iOS macOS

    Sets a fixed, preferred width for the inspector containing this view when presented as a trailing column.

  • .invalidatableContent() iOS macOS watchOS tvOS xrOS

    Mark the receiver as their content might be invalidated.

  • .keyframeAnimator() iOS macOS watchOS tvOS xrOS

    Plays the given keyframes when the given trigger value changes, updating the view using the modifiers you apply in body.

  • .layerEffect() iOS macOS tvOS xrOS

    Returns a new view that applies shader to self as a filter on the raster layer created from self.

  • .layoutDirectionBehavior() iOS macOS watchOS tvOS xrOS

    Sets the behavior of this view for different layout directions.

  • .listRowHoverEffect() xrOS

    Requests that the containing list row use the provided hover effect.

  • .listRowHoverEffectDisabled() xrOS

    Requests that the containing list row have its hover effect disabled.

  • .listSectionSpacing() iOS watchOS xrOS

    Sets the spacing between adjacent sections in a List.

  • .menuIndicator() iOS macOS tvOS xrOS

    Sets the menu indicator visibility for controls within this view.

  • .menuStyle() iOS macOS tvOS xrOS

    Sets the style for menus within this view.

  • .modelContainer() SwiftData iOS macOS watchOS tvOS

    Sets the model container and associated model context in this view’s environment.

  • .modelContext() SwiftData iOS macOS watchOS tvOS

    Sets the model context in this view’s environment.

  • .onInAppPurchaseCompletion() StoreKit iOS macOS watchOS tvOS xrOS

    Add an action to perform when a purchase initiated from an in-app store within this view completes.

  • .onInAppPurchaseStart() StoreKit iOS macOS watchOS tvOS xrOS

    Add an action to perform when a user triggers the purchase button on an in-app store within this view.

  • .onKeyPress() iOS macOS tvOS xrOS

    Performs an action if the user presses a key on a hardware keyboard while the view has focus.

  • .ornament() xrOS

    Presents an ornament.

  • .padding3D() xrOS

    Pads this view using the edge insets you specify.

  • .paletteSelectionEffect() iOS macOS xrOS

    Specifies the selection effect to apply to a palette item.

  • .perspectiveRotationEffect() xrOS

    Rotates this view’s rendered output in three dimensions around the given axis of rotation.

  • .phaseAnimator() iOS macOS watchOS tvOS xrOS

    Cycles through the given phases continuously, updating the content using the view builder closure that you supply.

  • .photosPickerAccessoryVisibility() Photos iOS macOS

    Sets the accessory visibility of the Photos picker. Accessories include anything between the content and the edge, like the navigation bar or the sidebar.

  • .photosPickerDisabledCapabilities() Photos iOS macOS

    Disables capabilities of the Photos picker.

  • .photosPickerStyle() Photos iOS macOS

    Sets the mode of the Photos picker.

  • .preferredSurroundingsEffect() xrOS

    Sets the preference for the video passthrough effect of the user’s surroundings. Use nil to state no preference. Note that this modifier only sets a preference and ultimately the system will decide if it will honor it or not.

  • .productViewStyle() StoreKit iOS macOS watchOS tvOS xrOS

    Sets the style for in-app store products within a view.

  • .refundRequestSheet() StoreKit iOS macOS xrOS

    Display the refund request sheet for the given transaction.

  • .safeAreaPadding() iOS macOS watchOS tvOS xrOS

    Adds the provided insets into the safe area of this view.

  • .scrollClipDisabled() iOS macOS watchOS tvOS xrOS

    Sets whether a scroll view clips its content to its bounds.

  • .scrollIndicatorsFlash() iOS macOS watchOS tvOS xrOS

    Flashes the scroll indicators of scrollable views when a value changes.

  • .scrollPosition() iOS macOS watchOS tvOS xrOS

    Associates a binding to be updated when a scroll view within this view scrolls.

  • .scrollTarget() iOS macOS watchOS tvOS xrOS

    Configures this view as a scroll target.

  • .scrollTargetBehavior() iOS macOS watchOS tvOS xrOS

    Sets the scroll behavior of views scrollable in the provided axes.

  • .scrollTargetLayout() iOS macOS watchOS tvOS xrOS

    Configures the outermost layout as a scroll target layout.

  • .scrollTransition() iOS macOS watchOS tvOS xrOS

    Applies the given transition, animating between the phases of the transition as this view appears and disappears within the visible region of the containing scroll view, or other container specified using the coordinateSpace parameter.

  • .searchDictationBehavior() iOS xrOS

  • .selectionDisabled() iOS macOS watchOS tvOS xrOS

    Adds a condition that controls whether users can select this view.

  • .sensoryFeedback() iOS macOS watchOS tvOS

    Plays the specified feedback when the provided trigger value changes.

  • .springLoadingBehavior() iOS macOS watchOS tvOS xrOS

    Sets the spring loading behavior this view.

  • .storeButton() StoreKit iOS macOS watchOS tvOS xrOS

    Specifies the visibility of certain kinds of auxiliary buttons used by StoreView or SubscriptionStoreView instances within the view.

  • .storeProductsTask() StoreKit iOS macOS watchOS tvOS xrOS

    Declares the view as dependent on a collection of in-app purchase products and returns a modified view.

  • .storeProductTask() StoreKit iOS macOS watchOS tvOS xrOS

    Declares the view as dependent on the in-app purchase product for id and returns a modified view.

  • .subscriptionStatusTask() StoreKit iOS macOS watchOS tvOS xrOS

    Declares the view as dependent on the status of an auto-renewable subscription group for groupID and returns a modified view.

  • .subscriptionStoreButtonLabel() StoreKit iOS macOS watchOS xrOS

    Configures in-app subscription store instances within a view to use a certain button label.

  • .subscriptionStoreControlIcon() StoreKit iOS macOS watchOS tvOS xrOS

    Set a view to use to decorate individual subscription options within a SubscriptionStoreView.

  • .subscriptionStoreControlStyle() StoreKit iOS macOS watchOS tvOS xrOS

    Sets the control style for in-app subscription stores within a view.

  • .subscriptionStorePickerItemBackground() StoreKit iOS macOS watchOS xrOS

    Sets the background style for picker items of SubscriptionStoreView instances within this view.

  • .subscriptionStorePolicyDestination() StoreKit iOS macOS watchOS tvOS xrOS

    Configures a view as the destination when someone chooses to view the corresponding policy in a SubscriptionStoreView within this view.

  • .subscriptionStorePolicyForegroundStyle() StoreKit iOS macOS watchOS tvOS xrOS

    Sets the style for terms of service or privacy policy buttons created by SubscriptionStoreView within a view.

  • .subscriptionStoreSignInAction() StoreKit iOS macOS watchOS tvOS xrOS

    Add an action to perform when someone triggers the sign in button on a SubscriptionStoreView within this view.

  • .symbolEffect() iOS macOS watchOS tvOS xrOS

    Returns a new view with a symbol effect added to it.

  • .symbolEffectsRemoved() iOS macOS watchOS tvOS xrOS

    Returns a new view with its inherited symbol image effects either removed or left unchanged.

  • .tableColumnHeaders() iOS macOS xrOS

    Controls the visibility of a Table’s column header views.

  • .textEditorStyle() iOS macOS xrOS

    Sets the style for text editors within this view.

  • .textScale() iOS macOS watchOS tvOS xrOS

    Applies a text scale to text in the view.

  • .toolbarTitleDisplayMode() iOS macOS watchOS tvOS xrOS

    Configures the toolbar title display mode for this view.

  • .transform3DEffect() xrOS

    Applies a 3D transformation to the receiver.

  • .typesettingLanguage() iOS macOS watchOS tvOS xrOS

    Specifies the language for typesetting.

  • .visualEffect() iOS macOS watchOS tvOS xrOS

    Applies effects to this view, while providing access to layout information via GeometryProxy.

  • .visualEffect3D() xrOS

    Applies effects to this view, while providing access to layout information via GeometryProxy3D.

  • .widgetCurvesContent() WidgetKit iOS watchOS xrOS

    Displays the widget’s content along a curve if the context allows it.

Scene Modifiers SwiftUI 5.0  –  2023

  • .defaultSize() macOS iOS xrOS

    Sets a default size for a window.

  • .immersionStyle() xrOS

    Sets the allowed styles for the immersive space.

  • .modelContainer() SwiftData iOS macOS watchOS tvOS

    Sets the model container and associated model context in this scene’s environment.

  • .modelContext() SwiftData iOS macOS watchOS tvOS

    Sets the model context in this scene’s environment.

  • .windowResizability() macOS iOS xrOS

    Sets the kind of resizability to use for a window.

Environment Values SwiftUI 5.0  –  2023

  • \.accessibilityDimFlashingLights iOS macOS watchOS tvOS xrOS

    Whether the setting to reduce flashing or strobing lights in video content is on. This setting can also be used to determine if UI in playback controls should be shown to indicate upcoming content that includes flashing or strobing lights.

  • \.accessibilityPlayAnimatedImages iOS macOS watchOS tvOS xrOS

    Whether the setting for playing animations in an animated image is on. When this value is false, any presented image that contains animation should not play automatically.

  • \.accessibilityPrefersCameraAnchorAlternative xrOS

    Whether the system setting to prefer alternatives to camera-anchored content is on.

  • \.allowedDynamicRange iOS macOS tvOS xrOS

    The allowed dynamic range for the view, or nil.

  • \.backgroundProminence iOS macOS watchOS tvOS xrOS

    The prominence of the background underneath views associated with this environment.

  • \.badgeProminence iOS macOS xrOS

    The prominence to apply to badges associated with this environment.

  • \.buttonRepeatBehavior iOS macOS watchOS tvOS xrOS

    Whether buttons with this associated environment should repeatedly trigger their actions on prolonged interactions.

  • \.dismissImmersiveSpace xrOS

    An immersive space dismissal action stored in a view’s environment.

  • \.dismissWindow iOS macOS xrOS

    A window dismissal action stored in a view’s environment.

  • \.documentConfiguration iOS macOS xrOS

    The configuration of a document in a DocumentGroup.

  • \.isFocusEffectEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the view associated with this environment allows focus effects to be displayed.

  • \.isHoverEffectEnabled iOS tvOS xrOS

    A Boolean value that indicates whether the view associated with this environment allows hover effects to be displayed.

  • \.menuIndicatorVisibility iOS macOS tvOS xrOS

    The menu indicator visibility to apply to controls within a view.

  • \.modelContext SwiftData iOS macOS watchOS tvOS

    The SwiftData model context that will be used for queries and other model operations within this environment.

  • \.openImmersiveSpace xrOS

    An action that presents an immersive space.

  • \.physicalMetrics xrOS

    The physical metrics associated with a scene.

  • \.purchase StoreKit iOS macOS watchOS tvOS xrOS

    An action that starts an in-app purchase.

  • \.springLoadingBehavior iOS macOS watchOS tvOS xrOS

    The behavior of spring loaded interactions for the views associated with this environment.

  • \.widgetContentMargins WidgetKit iOS macOS watchOS xrOS

    A property that identifies the content margins of a widget.

Property Wrappers SwiftUI 5.0  –  2023

  • @PhysicalMetric xrOS

    Provides access to a value in points that corresponds to the specified physical measurement.

Other Updates SwiftUI 5.0  –  2023

  • AccessibilityTraits:

    • .isToggle iOS macOS watchOS tvOS xrOS

      The accessibility element is a toggle.

  • Animation:

  • ButtonBorderShape:

  • Color:

    • .resolve(in:) iOS macOS watchOS tvOS xrOS

      Evaluates this color to a resolved color given the current context.

  • ContentShapeKinds:

    • .accessibility iOS macOS watchOS tvOS xrOS

      The kind for accessibility visuals and sorting.

    • .contextMenuPreview iOS tvOS xrOS

      The kind for context menu previews.

  • ContentTransition:

    • .symbolEffect iOS macOS watchOS tvOS xrOS

      A content transition that applies the default symbol effect transition to symbol images within the inserted or removed view hierarchy. Other views are unaffected by this transition.

    • .symbolEffect(_:options:) iOS macOS watchOS tvOS xrOS

      Creates a content transition that applies the symbol Replace animation to symbol images that it is applied to.

  • ControlGroupStyle:

    • .palette iOS macOS xrOS

      A control group style that presents its content as a palette.

  • DialogSeverity:

    • .standard macOS watchOS xrOS

      A severity that indicates the dialog is being displayed for the purpose of presenting information to the user.

  • HoverEffect:

    • .highlight iOS tvOS xrOS

      An effect that morphs the pointer into a platter behind the view and shows a light source indicating position.

  • MenuActionDismissBehavior:

    • .disabled iOS tvOS xrOS

      Never dismiss the presented menu after performing an action.

  • NSHostingController:

    • .sceneBridgingOptions macOS

      The options for which aspects of the window will be managed by this controller’s hosting view.

  • NSHostingView:

    • .sceneBridgingOptions macOS

      The options for which aspects of the window will be managed by this hosting view.

  • PickerStyle:

    • .menu iOS macOS tvOS xrOS

      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.

    • .palette iOS macOS xrOS

      A picker style that presents the options as a row of compact elements.

  • PrimitiveButtonStyle:

    • .accessoryBar macOS xrOS

      A button style that is typically used in the context of an accessory toolbar (sometimes refererred to as a “scope bar”), for buttons that narrow the focus of a search or other operation.

    • .accessoryBarAction macOS xrOS

      A button style that you use for extra actions in an accessory toolbar.

    • .borderless iOS macOS watchOS tvOS xrOS

      A button style that doesn’t apply a border.

  • RedactionReasons:

    • .invalidated iOS macOS watchOS tvOS xrOS

      Displayed data should appear as invalidated and pending a new update.

  • Shape:

    • .buttonBorder iOS macOS watchOS tvOS xrOS

      A shape that defers to the environment to determine the resolved button border shape.

    • .fill(_:style:) iOS macOS watchOS tvOS xrOS

      Fills this shape with a color or gradient.

    • .intersection(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with filled regions common to both shapes.

    • .layoutDirectionBehavior iOS macOS watchOS tvOS xrOS

      Returns the behavior this shape should use for different layout directions.

    • .lineIntersection(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with a line from this shape that overlaps the filled regions of the given shape.

    • .lineSubtraction(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with a line from this shape that does not overlap the filled region of the given shape.

    • .stroke(_:lineWidth:antialiased:) iOS macOS watchOS tvOS xrOS

      Traces the outline of this shape with a color or gradient.

    • .stroke(_:style:antialiased:) iOS macOS watchOS tvOS xrOS

      Traces the outline of this shape with a color or gradient.

    • .subtracting(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with filled regions from this shape that are not in the given shape.

    • .symmetricDifference(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with filled regions either from this shape or the given shape, but not in both.

    • .union(_:eoFill:) iOS macOS watchOS tvOS xrOS

      Returns a new shape with filled regions in either this shape or the given shape.

  • ShapeStyle:

    • .fill iOS macOS watchOS tvOS xrOS

      An overlay fill style for filling shapes.

    • .link iOS macOS watchOS tvOS xrOS

      A style appropriate for links.

    • .placeholder iOS macOS watchOS tvOS xrOS

      A style appropriate for placeholder text.

    • .quaternary iOS macOS watchOS tvOS xrOS

      Returns the fourth level of this shape style.

    • .regularMaterial iOS macOS tvOS watchOS xrOS

      A material that’s somewhat translucent.

    • .resolve(in:) iOS macOS watchOS tvOS xrOS

      Evaluate to a resolved shape style given the current environment.

    • .secondary iOS macOS watchOS tvOS xrOS

      Returns the second level of this shape style.

    • .separator macOS iOS watchOS tvOS xrOS

      A style appropriate for foreground separator or border lines.

    • .tertiary iOS macOS watchOS tvOS xrOS

      Returns the third level of this shape style.

    • .thickMaterial iOS macOS tvOS watchOS xrOS

      A material that’s more opaque than translucent.

    • .thinMaterial iOS macOS tvOS watchOS xrOS

      A material that’s more translucent than opaque.

    • .ultraThickMaterial iOS macOS tvOS watchOS xrOS

      A mostly opaque material.

    • .ultraThinMaterial iOS macOS tvOS watchOS xrOS

      A mostly translucent material.

  • TableColumnContent:

  • TableRowContent:

    • .draggable(_:) iOS macOS xrOS

      Activates this row as the source of a drag and drop operation.

    • .dropDestination(for:action:) iOS macOS xrOS

      Defines the entire row as a destination of a drag and drop operation that handles the dropped content with a closure that you specify.

    • .onHover(perform:) macOS xrOS

      Adds an action to perform when the pointer moves onto or away from the entire row.

  • TabViewStyle:

    • .verticalPage watchOS

      A TabViewStyle that implements the vertical page TabView interaction and appearance.

    • .verticalPage(transitionStyle:) watchOS

      A TabViewStyle that implements the vertical page TabView interaction and appearance, and performs the specified transition.

  • ToolbarItemPlacement:

    • .bottomBar iOS watchOS xrOS

      Places the item in the bottom toolbar.

    • .topBarLeading iOS tvOS watchOS xrOS

      Places the item in the leading edge of the top bar.

    • .topBarTrailing iOS tvOS watchOS xrOS

      Places the item in the trailing edge of the top bar.

  • ToolbarPlacement:

    • .bottomBar iOS watchOS xrOS

      The bottom toolbar of an app.

  • WidgetConfiguration:

SwiftUI 4.0 (2022) iOS 16|macOS 13|watchOS 9|tvOS 16|xrOS 0

Added in 16.4

Added in 16.1

  • .dynamicIsland() WidgetKit iOS xrOS

    Specifies the vertical placement for a view of an expanded Live Activity that appears in the Dynamic Island.

  • .fontDesign() iOS macOS watchOS tvOS xrOS

    Sets the font design of the text in this view.

  • .fontWidth() iOS macOS watchOS tvOS xrOS

    Sets the font width of the text in this view.

Added in RC

  • \.isLuminanceReduced watchOS iOS macOS tvOS xrOS

    A Boolean value that indicates whether the display or environment currently requires reduced luminance.

Added in Beta 5

  • .chartXAxisLabel() Charts iOS macOS watchOS tvOS xrOS

    Adds x axis label for charts in the view.

  • .chartYAxisLabel() Charts iOS macOS watchOS tvOS xrOS

    Adds y axis label for charts in the view.

Added in Beta 4

  • .activityBackgroundTint() WidgetKit iOS xrOS

    Sets the tint color for the background of a Live Activity that appears on the Lock Screen.

  • .activitySystemActionForegroundColor() WidgetKit iOS xrOS

    The text color for the auxiliary action button that the system shows next to a Live Activity on the Lock Screen.

Added in Beta 3

  • .chartLineStyleScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the line style scale for charts.

  • .copyable() macOS

    Specifies a list of items to copy in response to the system’s Copy command.

  • .cuttable() macOS

    Specifies an action that moves items to the Clipboard in response to the system’s Cut command.

  • .exportableToServices() macOS

    Exports items for consumption by shortcuts, quick actions, and services.

  • .focusedObject() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided object to other views whose state depends on the focused view hierarchy.

  • .focusedSceneObject() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided object to other views whose whose state depends on the active scene.

  • .importableFromServices() macOS

    Enables importing items from services, such as Continuity Camera on macOS.

  • .pasteDestination() macOS

    Specifies an action that adds validated items to a view in response to the system’s Paste command.

  • .scrollContentBackground() iOS macOS watchOS xrOS

    Specifies the visibility of the background for scrollable views within this view.

  • .searchScopes() iOS macOS tvOS xrOS

    Configures the search scopes for this view.

  • .toolbarTitleMenu() iOS macOS watchOS tvOS xrOS

    Configure the title menu of a toolbar.

  • @FocusedObject iOS macOS watchOS tvOS xrOS

    A property wrapper type for an observable object supplied by the focused view or one of its ancestors.

Added in Beta 2

  • .monospaced() iOS macOS watchOS tvOS xrOS

    Modifies the fonts of all child views to use the fixed-width variant of the current font, if possible.

Views SwiftUI 4.0  –  2022

  • AddPassToWalletButton PassKit iOS xrOS

  • AnyShape iOS macOS watchOS tvOS xrOS

    A type-erased shape value.

  • AsyncShareablePassConfiguration PassKit iOS xrOS

  • CameraView HomeKit iOS watchOS tvOS Catalyst xrOS

    A SwiftUI view into which a video stream or an image snapshot is rendered.

  • DefaultDateProgressLabel iOS macOS watchOS tvOS xrOS

    The default type of the current value label when used by a date-relative progress view.

  • DevicePicker DeviceDiscoveryUI tvOS

    A SwiftUI view that displays other devices on the network, and creates an encrypted connection to a copy of your app running on that device.

  • Gauge watchOS iOS macOS xrOS

    A view that shows a value within a range.

  • Grid iOS macOS watchOS tvOS xrOS

    A container view that arranges other views in a two dimensional layout.

  • GridRow iOS macOS watchOS tvOS xrOS

    A horizontal row in a two dimensional grid container.

  • LabeledContent iOS macOS watchOS tvOS xrOS

    A container for attaching a label to a value-bearing view.

  • LocalAuthenticationView Local Authentication macOS

    A SwiftUI view that displays an authentication interface.

  • MultiDatePicker iOS xrOS

    A control for picking multiple dates.

  • NavigationSplitView iOS macOS watchOS tvOS xrOS

    A view that presents views in two or three columns, where selections in leading columns control presentations in subsequent columns.

  • NavigationStack iOS macOS watchOS tvOS xrOS

    A view that displays a root view and enables you to present additional views over the root view.

  • PasteButton macOS iOS xrOS

    A system button that reads items from the pasteboard and delivers it to a closure.

  • PayWithApplePayButton PassKit iOS macOS watchOS xrOS

  • PhotosPicker PhotosUI iOS macOS watchOS xrOS

    A view that displays a Photos picker for choosing assets from the photo library.

  • RenameButton iOS macOS watchOS tvOS xrOS

    A button that triggers a standard rename action.

  • ShareLink iOS macOS watchOS xrOS

    A view that controls a sharing presentation.

  • Stepper iOS macOS watchOS xrOS

    A control that performs increment and decrement actions.

  • Table macOS iOS xrOS

    A container that presents rows of data arranged in one or more columns, optionally providing the ability to select one or more members.

  • TextFieldLink watchOS

    A control that requests text input from the user when pressed.

  • UnevenRoundedRectangle iOS macOS watchOS tvOS xrOS

    A rectangular shape with rounded corners with different values, aligned inside the frame of the view containing it.

  • VerifyIdentityWithWalletButton PassKit iOS xrOS

    A view that displays a button for identity verification.

  • ViewThatFits iOS macOS watchOS tvOS xrOS

    A view that adapts to the available space by providing the first child view that fits.

Scenes SwiftUI 4.0  –  2022

  • MenuBarExtra macOS

    A scene that renders itself as a persistent control in the system menu bar.

  • Window macOS

    A scene that presents its content in a single, unique window.

Classes SwiftUI 4.0  –  2022

  • ImageRenderer iOS macOS watchOS tvOS xrOS

    An object that creates images from SwiftUI views.

View Modifiers SwiftUI 4.0  –  2022

  • .accessibilityActions() iOS macOS watchOS tvOS xrOS

    Adds multiple accessibility actions to the view.

  • .accessibilityQuickAction() watchOS

    Adds a quick action to be shown by the system when active.

  • .accessibilityZoomAction() iOS macOS watchOS tvOS xrOS

    Adds an accessibility zoom action to the view. Actions allow assistive technologies, such as VoiceOver, to interact with the view by invoking the action.

  • .activityBackgroundTint() WidgetKit iOS xrOS

    Sets the tint color for the background of a Live Activity that appears on the Lock Screen.

  • .activitySystemActionForegroundColor() WidgetKit iOS xrOS

    The text color for the auxiliary action button that the system shows next to a Live Activity on the Lock Screen.

  • .backgroundStyle() iOS macOS watchOS tvOS xrOS

    Sets the specified style to render backgrounds within the view.

  • .baselineOffset() iOS macOS watchOS tvOS xrOS

    Sets the vertical offset for the text relative to its baseline in this view.

  • .bold() iOS macOS watchOS tvOS xrOS

    Applies a bold font weight to the text in this view.

  • .chartBackground() Charts iOS macOS watchOS tvOS xrOS

    Adds a background to a view that contains a chart.

  • .chartForegroundStyleScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the foreground style scale for charts.

  • .chartLegend() Charts iOS macOS watchOS tvOS xrOS

    Configures the legend for charts.

  • .chartLineStyleScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the line style scale for charts.

  • .chartOverlay() Charts iOS macOS watchOS tvOS xrOS

    Adds an overlay to a view that contains a chart.

  • .chartPlotStyle() Charts iOS macOS watchOS tvOS xrOS

    Configures the plot area of charts.

  • .chartSymbolScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the symbol scale for charts.

  • .chartSymbolSizeScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the symbol size scale for charts.

  • .chartXAxis() Charts iOS macOS watchOS tvOS xrOS

    Sets the visibility of the x axis.

  • .chartXAxisLabel() Charts iOS macOS watchOS tvOS xrOS

    Adds x axis label for charts in the view.

  • .chartXScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the x scale for charts.

  • .chartYAxis() Charts iOS macOS watchOS tvOS xrOS

    Sets the visibility of the y axis.

  • .chartYAxisLabel() Charts iOS macOS watchOS tvOS xrOS

    Adds y axis label for charts in the view.

  • .chartYScale() Charts iOS macOS watchOS tvOS xrOS

    Configures the y scale for charts.

  • .contentTransition() iOS macOS watchOS tvOS xrOS

    Modifies the view to use a given transition as its method of animating changes to the contents of its views.

  • .controlSize() iOS macOS watchOS xrOS

    Sets the size for controls within this view.

  • .copyable() macOS

    Specifies a list of items to copy in response to the system’s Copy command.

  • .cuttable() macOS

    Specifies an action that moves items to the Clipboard in response to the system’s Cut command.

  • .defaultFocus() macOS watchOS tvOS iOS xrOS

    Defines a region of the window in which default focus is evaluated by assigning a value to a given focus state binding.

  • .defersSystemGestures() iOS

    Sets the screen edge from which you want your gesture to take precedence over the system gesture.

  • .dialogIcon() macOS watchOS xrOS

    Configures the icon used by dialogs within this view.

  • .dialogSeverity() macOS watchOS xrOS

  • .digitalCrownAccessory() watchOS

    Specifies the visibility of Digital Crown accessory Views on Apple Watch.

  • .disclosureGroupStyle() iOS macOS xrOS

    Sets the style for disclosure groups within this view.

  • .draggable() iOS macOS xrOS

    Activates this view as the source of a drag and drop operation.

  • .dropDestination() iOS macOS xrOS

    Defines the destination of a drag and drop operation that handles the dropped content with a closure that you specify.

  • .dynamicIsland() WidgetKit iOS xrOS

    Specifies the vertical placement for a view of an expanded Live Activity that appears in the Dynamic Island.

  • .exportableToServices() macOS

    Exports items for consumption by shortcuts, quick actions, and services.

  • .findDisabled() iOS xrOS

    Prevents find and replace operations in a text editor.

  • .findNavigator() iOS xrOS

    Programmatically presents the find and replace interface for text editor views.

  • .focusedObject() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided object to other views whose state depends on the focused view hierarchy.

  • .focusedSceneObject() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided object to other views whose whose state depends on the active scene.

  • .focusSection() tvOS macOS

    Indicates that the view’s frame and cohort of focusable descendants should be used to guide focus movement.

  • .fontDesign() iOS macOS watchOS tvOS xrOS

    Sets the font design of the text in this view.

  • .fontWeight() iOS macOS watchOS tvOS xrOS

    Sets the font weight of the text in this view.

  • .fontWidth() iOS macOS watchOS tvOS xrOS

    Sets the font width of the text in this view.

  • .gaugeStyle() watchOS iOS macOS xrOS

    Sets the style for gauges within this view.

  • .gridCellAnchor() iOS macOS watchOS tvOS xrOS

    Specifies a custom alignment anchor for a view that acts as a grid cell.

  • .gridCellColumns() iOS macOS watchOS tvOS xrOS

    Tells a view that acts as a cell in a grid to span the specified number of columns.

  • .gridCellUnsizedAxes() iOS macOS watchOS tvOS xrOS

    Asks grid layouts not to offer the view extra size in the specified axes.

  • .gridColumnAlignment() iOS macOS watchOS tvOS xrOS

    Overrides the default horizontal alignment of the grid column that the view appears in.

  • .hoverEffect() iOS tvOS xrOS

    Applies a hover effect to this view.

  • .importableFromServices() macOS

    Enables importing items from services, such as Continuity Camera on macOS.

  • .interactionActivityTrackingTag() iOS macOS watchOS tvOS xrOS

    Sets a tag that you use for tracking interactivity.

  • .italic() iOS macOS watchOS tvOS xrOS

    Applies italics to the text in this view.

  • .kerning() iOS macOS watchOS tvOS xrOS

    Sets the spacing, or kerning, between characters for the text in this view.

  • .layoutValue() iOS macOS watchOS tvOS xrOS

    Associates a value with a custom layout property.

  • .listRowSeparator() iOS macOS xrOS

    Sets the display mode for the separator associated with this specific row.

  • .listRowSeparatorTint() iOS macOS xrOS

    Sets the tint color associated with a row.

  • .listSectionSeparator() iOS macOS xrOS

    Sets whether to hide the separator associated with a list section.

  • .listSectionSeparatorTint() iOS macOS xrOS

    Sets the tint color associated with a section.

  • .menuActionDismissBehavior() iOS macOS watchOS tvOS xrOS

    Tells a menu whether to dismiss after performing an action.

  • .menuOrder() iOS macOS watchOS tvOS xrOS

    Sets the preferred order of items for menus presented from this view.

  • .monospaced() iOS macOS watchOS tvOS xrOS

    Modifies the fonts of all child views to use the fixed-width variant of the current font, if possible.

  • .navigationBarBackButtonHidden() iOS watchOS tvOS macOS xrOS

    Hides the navigation bar back button for the view.

  • .navigationDestination() iOS macOS watchOS tvOS xrOS

    Associates a destination view with a presented data type for use within a navigation stack.

  • .navigationDocument() iOS macOS watchOS tvOS xrOS

    Configures the view’s document for purposes of navigation.

  • .navigationSplitViewColumnWidth() iOS macOS watchOS tvOS xrOS

    Sets a fixed, preferred width for the column containing this view.

  • .navigationSplitViewStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for navigation split views within this view.

  • .offerCodeRedemption() StoreKit iOS xrOS

    Presents a sheet that enables users to redeem subscription offer codes that you configure in App Store Connect.

  • .onContinuousHover() iOS macOS tvOS xrOS

    Adds an action to perform when the pointer enters, moves within, and exits the view’s bounds.

  • .onLongTouchGesture() tvOS

    Adds an action to perform when this view recognizes a remote long touch gesture. A long touch gesture is when the finger is on the remote touch surface without actually pressing.

  • .onTapGesture() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when this view recognizes a tap gesture.

  • .pasteDestination() macOS

    Specifies an action that adds validated items to a view in response to the system’s Paste command.

  • .persistentSystemOverlays() iOS macOS watchOS tvOS xrOS

    Sets the preferred visibility of the non-transient system views overlaying the app.

  • .photosPicker() Photos iOS macOS watchOS

    Presents a Photos picker that selects a PhotosPickerItem.

  • .presentationBackground() iOS macOS watchOS tvOS xrOS

    Sets the presentation background of the enclosing sheet using a shape style.

  • .presentationBackgroundInteraction() iOS macOS watchOS tvOS xrOS

    Controls whether people can interact with the view behind a presentation.

  • .presentationCompactAdaptation() iOS macOS watchOS tvOS xrOS

    Specifies how to adapt a presentation to compact size classes.

  • .presentationContentInteraction() iOS macOS watchOS tvOS xrOS

    Configures the behavior of swipe gestures on a presentation.

  • .presentationCornerRadius() iOS macOS watchOS tvOS xrOS

    Requests that the presentation have a specific corner radius.

  • .presentationDetents() iOS macOS watchOS tvOS xrOS

    Sets the available detents for the enclosing sheet.

  • .presentationDragIndicator() iOS macOS watchOS tvOS xrOS

    Sets the visibility of the drag indicator on top of a sheet.

  • .renameAction() iOS macOS watchOS tvOS xrOS

    Sets a closure to run for the rename action.

  • .replaceDisabled() iOS xrOS

    Prevents replace operations in a text editor.

  • .scrollBounceBehavior() iOS macOS watchOS tvOS xrOS

    Configures the bounce behavior of scrollable views along the specified axis.

  • .scrollContentBackground() iOS macOS watchOS xrOS

    Specifies the visibility of the background for scrollable views within this view.

  • .scrollDisabled() iOS macOS watchOS tvOS xrOS

    Disables or enables scrolling in scrollable views.

  • .scrollDismissesKeyboard() iOS macOS watchOS tvOS

    Configures the behavior in which scrollable content interacts with the software keyboard.

  • .scrollIndicators() iOS macOS watchOS tvOS xrOS

    Sets the visibility of scroll indicators within this view.

  • .searchScopes() iOS macOS tvOS xrOS

    Configures the search scopes for this view.

  • .searchSuggestions() iOS macOS watchOS tvOS xrOS

    Configures the search suggestions for this view.

  • .shortcutsLinkStyle() AppIntents iOS

    Sets the given style for ShortcutsLinks within the view hierarchy

  • .siriTipViewStyle() AppIntents iOS

    Sets the given style for SiriTipView within the view hierarchy

  • .strikethrough() iOS macOS watchOS tvOS xrOS

    Applies a strikethrough to the text in this view.

  • .tableStyle() macOS iOS xrOS

    Sets the style for tables within this view.

  • .toolbarBackground() iOS macOS watchOS tvOS xrOS

    Specifies the preferred visibility of backgrounds on a bar managed by SwiftUI.

  • .toolbarColorScheme() iOS macOS watchOS tvOS xrOS

    Specifies the preferred color scheme of a bar managed by SwiftUI.

  • .toolbarRole() iOS macOS watchOS tvOS xrOS

    Configures the semantic role for the content populating the toolbar.

  • .toolbarTitleMenu() iOS macOS watchOS tvOS xrOS

    Configure the title menu of a toolbar.

  • .tracking() iOS macOS watchOS tvOS xrOS

    Sets the tracking for the text in this view.

  • .typeSelectEquivalent() iOS macOS watchOS tvOS xrOS

    Sets an explicit type select equivalent text in a collection, such as a list or table.

  • .underline() iOS macOS watchOS tvOS xrOS

    Applies an underline to the text in this view.

  • .widgetAccentable() WidgetKit iOS macOS watchOS xrOS

    Adds the view and all of its subviews to the accented group.

  • .widgetLabel() WidgetKit iOS watchOS xrOS

    Returns a text label that displays additional content outside the accessory family widget’s main SwiftUI view.

  • .widgetURL() WidgetKit iOS macOS watchOS xrOS

    Sets the URL to open in the containing app when the user clicks the widget.

Scene Modifiers SwiftUI 4.0  –  2022

  • .backgroundTask() iOS macOS watchOS tvOS xrOS

    Runs the specified action when the system provides a background task.

  • .commandsRemoved() iOS macOS xrOS

    Removes all commands defined by the modified scene.

  • .commandsReplaced() iOS macOS xrOS

    Replaces all commands defined by the modified scene with the commands from the builder.

  • .defaultPosition() macOS

    Sets a default position for a window.

  • .defaultSize() macOS iOS xrOS

    Sets a default size for a window.

  • .keyboardShortcut() macOS

    Defines a keyboard shortcut for opening new scene windows.

  • .windowResizability() macOS iOS xrOS

    Sets the kind of resizability to use for a window.

Environment Values SwiftUI 4.0  –  2022

  • \.accessibilityQuickActionsEnabled iOS macOS watchOS tvOS xrOS

    A Boolean that indicates whether the quick actions feature is enabled.

  • \.authorizationController AuthenticationServices iOS macOS watchOS tvOS

    A value provided in the SwiftUI environment that views can use to perform authorization requests.

  • \.backgroundStyle iOS macOS watchOS tvOS xrOS

    An optional style that overrides the default system background style when set.

  • \.contentTransition iOS macOS watchOS tvOS xrOS

    The current method of animating the contents of views.

  • \.contentTransitionAddsDrawingGroup iOS macOS watchOS tvOS xrOS

    A Boolean value that controls whether views that render content transitions use GPU-accelerated rendering.

  • \.controlSize iOS macOS watchOS xrOS

    The size to apply to controls within a view.

  • \.displayStoreKitMessage StoreKit iOS xrOS

  • \.horizontalScrollBounceBehavior iOS macOS watchOS tvOS xrOS

    The scroll bounce mode for the horizontal axis of scrollable views.

  • \.horizontalScrollIndicatorVisibility iOS macOS watchOS tvOS xrOS

    The visibility to apply to scroll indicators of any horizontally scrollable content.

  • \.isActivityFullscreen WidgetKit iOS xrOS

    A Boolean value that indicates whether the Live Activity appears in a full-screen presentation.

  • \.isLuminanceReduced watchOS iOS macOS tvOS xrOS

    A Boolean value that indicates whether the display or environment currently requires reduced luminance.

  • \.isScrollEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether any scroll views associated with this environment allow scrolling to occur.

  • \.menuOrder iOS macOS watchOS tvOS xrOS

    The preferred order of items for menus presented from this view.

  • \.newDocument macOS

    An action in the environment that presents a new document.

  • \.openDocument macOS

    An action in the environment that presents an existing document.

  • \.openWindow iOS macOS xrOS

    An window presentation action stored in a view’s environment.

  • \.rename iOS macOS watchOS tvOS xrOS

    An action that activates the standard rename interaction.

  • \.requestReview StoreKit iOS macOS xrOS

  • \.scrollDismissesKeyboardMode iOS macOS watchOS tvOS

    The way that scrollable content interacts with the software keyboard.

  • \.searchSuggestionsPlacement iOS macOS watchOS tvOS xrOS

    The current placement of search suggestions.

  • \.showsWidgetLabel WidgetKit iOS watchOS xrOS

    A Boolean value that indicates whether an accessory family widget can display an accessory label.

  • \.sidebarRowSize iOS macOS watchOS tvOS xrOS

    The current size of sidebar rows.

  • \.supportsMultipleWindows iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the current platform supports opening multiple windows.

  • \.verticalScrollBounceBehavior iOS macOS watchOS tvOS xrOS

    The scroll bounce mode for the vertical axis of scrollable views.

  • \.verticalScrollIndicatorVisibility iOS macOS watchOS tvOS xrOS

    The visiblity to apply to scroll indicators of any vertically scrollable content.

  • \.webAuthenticationSession AuthenticationServices iOS macOS watchOS tvOS

    A value provided in the SwiftUI environment that views can use to authenticate a user through a web service.

  • \.widgetFamily WidgetKit iOS macOS watchOS xrOS

    The template of the widget — small, medium, or large.

  • \.widgetRenderingMode WidgetKit iOS macOS watchOS xrOS

    The widget’s rendering mode, based on where the system is displaying it.

Property Wrappers SwiftUI 4.0  –  2022

  • @FocusedObject iOS macOS watchOS tvOS xrOS

    A property wrapper type for an observable object supplied by the focused view or one of its ancestors.

Other Updates SwiftUI 4.0  –  2022

  • ButtonBorderShape:

    • .circle tvOS iOS macOS watchOS xrOS

  • Color:

    • .gradient iOS macOS watchOS tvOS xrOS

      Returns the standard gradient for the color self.

  • CommandGroupPlacement:

    • .singleWindowList macOS

      Placement for commands that describe and reveal any windows that the app defines.

  • ControlGroupStyle:

    • .compactMenu iOS macOS xrOS

      A control group style that presents its content as a compact menu when the user presses the control, or as a submenu when nested within a larger menu.

    • .menu iOS macOS tvOS xrOS

      A control group style that presents its content as a menu when the user presses the control, or as a submenu when nested within a larger menu.

  • Font:

    • .system(_:design:weight:) iOS macOS watchOS tvOS xrOS

      Gets a system font that uses the specified style, design, and weight.

    • .system(size:weight:design:) iOS macOS watchOS tvOS xrOS

      Specifies a system font to use, along with the style, weight, and any design parameters you want applied to the text.

    • .width(_:) iOS macOS watchOS tvOS xrOS

      Sets the width of the font.

  • GaugeStyle:

    • .accessoryCircular iOS macOS watchOS xrOS

      A gauge style that displays an open ring with a marker that appears at a point along the ring to indicate the gauge’s current value.

    • .accessoryCircularCapacity iOS macOS watchOS xrOS

      A gauge style that displays a closed ring that’s partially filled in to indicate the gauge’s current value.

    • .accessoryLinear iOS macOS watchOS xrOS

      A gauge style that displays bar with a marker that appears at a point along the bar to indicate the gauge’s current value.

    • .accessoryLinearCapacity iOS macOS watchOS xrOS

      A gauge style that displays bar that fills from leading to trailing edges as the gauge’s current value increases.

    • .linearCapacity iOS macOS watchOS xrOS

      A gauge style that displays a bar that fills from leading to trailing edges as the gauge’s current value increases.

  • HorizontalAlignment:

  • MenuStyle:

    • .button iOS macOS tvOS xrOS

      A menu style that displays a button that toggles the display of the menu’s contents when pressed.

  • NSHostingController:

    • .safeAreaRegions macOS

      The safe area regions that this view controller adds to its view.

    • .sizingOptions macOS

      The options for how the hosting controller’s view creates and updates constraints based on the size of its SwiftUI content.

  • NSHostingView:

    • .safeAreaRegions macOS

      The safe area regions that this view controller adds to its view.

    • .sizingOptions macOS

      The options for how the hosting view creates and updates constraints based on the size of its SwiftUI content.

  • NSViewControllerRepresentable:

  • NSViewRepresentable:

  • PickerStyle:

    • .navigationLink iOS watchOS tvOS xrOS

      A picker style represented by a navigation link that presents the options by pushing a List-style picker view.

  • Shape:

    • .sizeThatFits(_:) iOS macOS watchOS tvOS xrOS

      Returns the size of the view that will render the shape, given a proposed size.

  • ShapeStyle:

  • TableRowContent:

  • ToggleStyle:

    • .button iOS macOS watchOS xrOS

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

  • ToolbarItemPlacement:

  • UIHostingController:

    • .safeAreaRegions iOS tvOS xrOS

      The safe area regions that this view controller adds to its view.

    • .sizingOptions iOS tvOS xrOS

      The options for how the hosting controller tracks changes to the size of its SwiftUI content.

  • UIViewControllerRepresentable:

  • UIViewRepresentable:

  • WidgetConfiguration:

SwiftUI 3.0 (2021) iOS 15|macOS 12|watchOS 8|tvOS 15|xrOS -1

Views SwiftUI 3.0  –  2021

  • AsyncImage iOS macOS watchOS tvOS xrOS

    A view that asynchronously loads and displays an image.

  • ButtonBorderShape iOS macOS watchOS tvOS xrOS

    A shape that is used to draw a button’s border.

  • Canvas iOS macOS watchOS tvOS xrOS

    A view type that supports immediate mode drawing.

  • ControlGroup iOS macOS tvOS xrOS

    A container view that displays semantically-related controls in a visually-appropriate manner for the context

  • EllipticalGradient iOS macOS watchOS tvOS xrOS

    A radial gradient that draws an ellipse.

  • LocationButton CoreLocationUI iOS watchOS

    A SwiftUI button that grants one-time location authorization.

  • Table macOS iOS xrOS

    A container that presents rows of data arranged in one or more columns, optionally providing the ability to select one or more members.

  • TimelineView iOS macOS watchOS tvOS xrOS

    A view that updates according to a schedule that you provide.

Commands SwiftUI 3.0  –  2021

View Modifiers SwiftUI 3.0  –  2021

  • .accessibilityChartDescriptor() iOS macOS watchOS tvOS xrOS

    Adds a descriptor to a View that represents a chart to make the chart’s contents accessible to all users.

  • .accessibilityChildren() iOS macOS watchOS tvOS xrOS

    Replaces the existing accessibility element’s children with one or more new synthetic accessibility elements.

  • .accessibilityCustomContent() iOS macOS watchOS tvOS xrOS

    Add additional accessibility information to the view.

  • .accessibilityFocused() iOS macOS watchOS tvOS xrOS

    Modifies this view by binding its accessibility element’s focus state to the given boolean state value.

  • .accessibilityHeading() iOS macOS watchOS tvOS xrOS

    Sets the accessibility level of this heading.

  • .accessibilityRepresentation() iOS macOS watchOS tvOS xrOS

    Replaces one or more accessibility elements for this view with new accessibility elements.

  • .accessibilityRespondsToUserInteraction() iOS macOS watchOS tvOS xrOS

    Explicitly set whether this Accessibility element responds to user interaction and would thus be interacted with by technologies such as Switch Control, Voice Control or Full Keyboard Access.

  • .accessibilityRotor() iOS macOS watchOS tvOS xrOS

    Create an Accessibility Rotor replacing the specified system-provided Rotor.

  • .accessibilityRotorEntry() iOS macOS watchOS tvOS xrOS

    Defines an explicit identifier tying an Accessibility element for this view to an entry in an Accessibility Rotor.

  • .accessibilityShowsLargeContentViewer() iOS macOS watchOS tvOS xrOS

    Adds a default large content view to be shown by the large content viewer.

  • .accessibilityTextContentType() iOS macOS watchOS tvOS xrOS

    Sets an accessibility text content type.

  • .autocorrectionDisabled() iOS macOS tvOS watchOS xrOS

    Sets whether to disable autocorrection for this view.

  • .badge() iOS macOS xrOS

    Generates a badge for the view from a string.

  • .buttonBorderShape() iOS macOS watchOS tvOS xrOS

    Sets the border shape for buttons in this view.

  • .confirmationDialog() iOS macOS watchOS tvOS xrOS

    Presents a confirmation dialog when a given condition is true, using a text view for the title.

  • .containerShape() iOS macOS watchOS tvOS xrOS

    Sets the container shape to use for any container relative shape within this view.

  • .controlGroupStyle() iOS macOS tvOS xrOS

    Sets the style for control groups within this view.

  • .controlSize() macOS iOS watchOS xrOS

    Sets the size for controls within this view.

  • .disableAutocorrection() Deprecated iOS macOS tvOS watchOS xrOS

    Sets whether to disable autocorrection for this view.

    → Use autocorrectionDisabled(_:) instead.

  • .dynamicTypeSize() iOS macOS watchOS tvOS xrOS

    Sets the Dynamic Type size within the view to the given value.

  • .exportsItemProviders() macOS

    Exports a read-only item provider for consumption by shortcuts, quick actions, and services.

  • .familyActivityPicker() FamilyControls iOS xrOS

    Presents an activity picker view as a sheet.

  • .focused() iOS macOS watchOS tvOS xrOS

    Modifies this view by binding its focus state to the given Boolean state value.

  • .focusedSceneValue() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided value to other views whose state depends on the active scene.

  • .focusScope() watchOS tvOS macOS

    Creates a focus scope that SwiftUI uses to limit default focus preferences.

  • .focusSection() tvOS macOS

    Indicates that the view’s frame and cohort of focusable descendants should be used to guide focus movement.

  • .foregroundStyle() iOS macOS watchOS tvOS xrOS

    Sets a view’s foreground elements to use a given style.

  • .headerProminence() iOS macOS watchOS tvOS xrOS

    Sets the header prominence for this view.

  • .importsItemProviders() macOS

    Enables importing item providers from services, such as Continuity Camera on macOS.

  • .indexViewStyle() iOS tvOS watchOS xrOS

    Sets the style for the index view within the current environment.

  • .interactiveDismissDisabled() iOS macOS watchOS tvOS xrOS

    Conditionally prevents interactive dismissal of presentations like popovers, sheets, and inspectors.

  • .listRowSeparator() iOS macOS xrOS

    Sets the display mode for the separator associated with this specific row.

  • .listRowSeparatorTint() iOS macOS xrOS

    Sets the tint color associated with a row.

  • .listRowSpacing() iOS xrOS

    Sets the vertical spacing between two adjacent rows in a List.

  • .listSectionSeparator() iOS macOS xrOS

    Sets whether to hide the separator associated with a list section.

  • .listSectionSeparatorTint() iOS macOS xrOS

    Sets the tint color associated with a section.

  • .manageSubscriptionsSheet() StoreKit iOS xrOS

  • .menuIndicator() iOS macOS tvOS xrOS

    Sets the menu indicator visibility for controls within this view.

  • .monospacedDigit() iOS macOS watchOS tvOS xrOS

    Modifies the fonts of all child views to use fixed-width digits, if possible, while leaving other characters proportionally spaced.

  • .musicSubscriptionOffer() MusicKit iOS macOS

    Initiates the process of presenting a sheet with subscription offers for Apple Music when the isPresented binding is true.

  • .navigationBarTitleDisplayMode() iOS watchOS xrOS

    Configures the title display mode for this view.

  • .onSubmit() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when the user submits a value to this view.

  • .prefersDefaultFocus() watchOS tvOS macOS

    Indicates that the view should receive focus by default for a given namespace.

  • .previewInterfaceOrientation() iOS macOS watchOS tvOS xrOS

    Overrides the orientation of the preview.

  • .privacySensitive() iOS macOS watchOS tvOS xrOS

    Marks the view as containing sensitive, private user data.

  • .refreshable() iOS macOS watchOS tvOS xrOS

    Marks this view as refreshable.

  • .refundRequestSheet() StoreKit iOS macOS xrOS

    Display the refund request sheet for the given transaction.

  • .safeAreaInset() iOS macOS watchOS tvOS xrOS

    Shows the specified content beside the modified view.

  • .scenePadding() iOS macOS watchOS tvOS xrOS

    Adds padding to the specified edges of this view using an amount that’s appropriate for the current scene.

  • .searchable() iOS macOS watchOS tvOS xrOS

    Marks this view as searchable, which configures the display of a search field.

  • .searchCompletion() iOS macOS watchOS tvOS xrOS

    Associates a fully formed string with the value of this view.

  • .speechAdjustedPitch() iOS macOS watchOS tvOS xrOS

    Raises or lowers the pitch of spoken text.

  • .speechAlwaysIncludesPunctuation() iOS macOS watchOS tvOS xrOS

    Sets whether VoiceOver should always speak all punctuation in the text view.

  • .speechAnnouncementsQueued() iOS macOS watchOS tvOS xrOS

    Controls whether to queue pending announcements behind existing speech rather than interrupting speech in progress.

  • .speechSpellsOutCharacters() iOS macOS watchOS tvOS xrOS

    Sets whether VoiceOver should speak the contents of the text view character by character.

  • .submitLabel() iOS macOS watchOS tvOS xrOS

    Sets the submit label for this view.

  • .submitScope() iOS macOS watchOS tvOS xrOS

    Prevents submission triggers originating from this view to invoke a submission action configured by a submission modifier higher up in the view hierarchy.

  • .swipeActions() iOS macOS watchOS xrOS

    Adds custom swipe actions to a row in a list.

  • .symbolRenderingMode() iOS macOS watchOS tvOS xrOS

    Sets the rendering mode for symbol images within this view.

  • .symbolVariant() iOS macOS watchOS tvOS xrOS

    Makes symbols within the view show a particular variant.

  • .tableStyle() macOS iOS xrOS

    Sets the style for tables within this view.

  • .task() iOS macOS watchOS tvOS xrOS

    Adds an asynchronous task to perform before this view appears.

  • .textInputAutocapitalization() iOS watchOS tvOS xrOS

    Sets how often the shift key in the keyboard is automatically enabled.

  • .textSelection() iOS macOS xrOS

    Controls whether people can select text within this view.

  • .tint() iOS macOS watchOS tvOS xrOS

    Sets the tint within this view.

Environment Values SwiftUI 3.0  –  2021

  • \.accessibilityLargeContentViewerEnabled iOS macOS watchOS tvOS xrOS

    Whether the Large Content Viewer is enabled.

  • \.accessibilitySwitchControlEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the Switch Control motor accessibility feature is in use.

  • \.accessibilityVoiceOverEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the VoiceOver screen reader is in use.

  • \.autocorrectionDisabled iOS macOS tvOS watchOS xrOS

    A Boolean value that determines whether the view hierarchy has auto-correction enabled.

  • \.backgroundMaterial iOS macOS watchOS tvOS xrOS

    The material underneath the current view.

  • \.controlSize macOS iOS watchOS xrOS

    The size to apply to controls within a view.

  • \.disableAutocorrection Deprecated iOS macOS tvOS watchOS xrOS

    A Boolean value that determines whether the view hierarchy has auto-correction enabled.

  • \.dismiss iOS macOS watchOS tvOS xrOS

    An action that dismisses the current presentation.

  • \.dismissSearch iOS macOS watchOS tvOS xrOS

    An action that ends the current search interaction.

  • \.dynamicTypeSize iOS macOS watchOS tvOS xrOS

    The current Dynamic Type size.

  • \.headerProminence iOS macOS watchOS tvOS xrOS

    The prominence to apply to section headers within a view.

  • \.isLuminanceReduced watchOS iOS macOS tvOS xrOS

    A Boolean value that indicates whether the display or environment currently requires reduced luminance.

  • \.isPresented iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the view associated with this environment is currently presented.

  • \.isSearching iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates when the user is searching.

  • \.keyboardShortcut iOS macOS xrOS

    The keyboard shortcut that buttons in this environment will be triggered with.

  • \.menuIndicatorVisibility iOS macOS tvOS xrOS

    The menu indicator visibility to apply to controls within a view.

  • \.refresh iOS macOS watchOS tvOS xrOS

    A refresh action stored in a view’s environment.

  • \.resetFocus watchOS tvOS macOS

    An action that requests the focus system to reevaluate default focus.

  • \.showsWidgetContainerBackground WidgetKit iOS macOS watchOS xrOS

    An environment variable that indicates whether the background of a widget appears.

  • \.symbolRenderingMode iOS macOS watchOS tvOS xrOS

    The current symbol rendering mode, or nil denoting that the mode is picked automatically using the current image and foreground style as parameters.

  • \.symbolVariants iOS macOS watchOS tvOS xrOS

    The symbol variant to use in this environment.

Property Wrappers SwiftUI 3.0  –  2021

  • @AccessibilityFocusState iOS macOS watchOS tvOS xrOS

    A property wrapper type that can read and write a value that SwiftUI updates as the focus of any active accessibility technology, such as VoiceOver, changes.

  • @FocusState iOS macOS watchOS tvOS xrOS

    A property wrapper type that can read and write a value that SwiftUI updates as the placement of focus within the scene changes.

  • @SectionedFetchRequest iOS macOS watchOS tvOS xrOS

    A property wrapper type that retrieves entities, grouped into sections, from a Core Data persistent store.

Other Updates SwiftUI 3.0  –  2021

  • Color:

    • .brown iOS macOS watchOS tvOS xrOS

      A context-dependent brown color suitable for use in UI elements.

    • .cyan iOS macOS watchOS tvOS xrOS

      A context-dependent cyan color suitable for use in UI elements.

    • .indigo iOS macOS watchOS tvOS xrOS

      A context-dependent indigo color suitable for use in UI elements.

    • .mint iOS macOS watchOS tvOS xrOS

      A context-dependent mint color suitable for use in UI elements.

    • .teal iOS macOS watchOS tvOS xrOS

      A context-dependent teal color suitable for use in UI elements.

  • FetchedResults:

    • .nsPredicate iOS macOS watchOS tvOS xrOS

      The request’s predicate.

    • .nsSortDescriptors iOS macOS watchOS tvOS xrOS

      The request’s sort descriptors, accessed as reference types.

    • .sortDescriptors iOS macOS watchOS tvOS xrOS

      The request’s sort descriptors, accessed as value types.

  • Font:

    • .monospaced() iOS macOS watchOS tvOS xrOS

      Returns a fixed-width font from the same family as the base font.

  • ListStyle:

    • .bordered macOS

      The list style that describes the behavior and appearance of a list with standard border.

    • .bordered(alternatesRowBackgrounds:) Deprecated macOS

      The list style that describes the behavior and appearance of a list with standard border.

      → Use the bordered style and add the alternatingRowBackgrounds(_:) view modifier instead.

    • .inset(alternatesRowBackgrounds:) Deprecated macOS

      The list style that describes the behavior and appearance of an inset list with optional alternating row backgrounds.

      → Use the inset style and add the alternatingRowBackgrounds(_:) view modifier instead.

  • NavigationViewStyle:

    • .columns Deprecated iOS macOS xrOS

      A navigation view style represented by a series of views in columns.

      → Replace a styled NavigationView with a NavigationStack or NavigationSplitView.

  • PageTabViewStyle.IndexDisplayMode:

    • .always iOS tvOS watchOS xrOS

      Always display an index view regardless of page count

    • .never iOS tvOS watchOS xrOS

      Never display an index view

  • PrimitiveButtonStyle:

    • .bordered macOS watchOS tvOS iOS xrOS

      A button style that applies standard border artwork based on the button’s context.

    • .borderedProminent iOS macOS watchOS tvOS xrOS

      A button style that applies standard border prominent artwork based on the button’s context.

    • .borderless iOS macOS watchOS tvOS xrOS

      A button style that doesn’t apply a border.

  • RedactionReasons:

    • .privacy iOS macOS watchOS tvOS xrOS

      Displayed data should be obscured to protect private information.

  • ShapeStyle:

    • .bar iOS macOS xrOS

      A material matching the style of system toolbars.

    • .blendMode(_:) iOS macOS watchOS tvOS xrOS

      Returns a new style based on self that applies the specified blend mode when drawing.

    • .brown iOS macOS watchOS tvOS xrOS

      A context-dependent brown color suitable for use in UI elements.

    • .cyan iOS macOS watchOS tvOS xrOS

      A context-dependent cyan color suitable for use in UI elements.

    • .ellipticalGradient(_:center:startRadiusFraction:endRadiusFraction:) iOS macOS watchOS tvOS xrOS

      A radial gradient that draws an ellipse.

    • .ellipticalGradient(colors:center:startRadiusFraction:endRadiusFraction:) iOS macOS watchOS tvOS xrOS

      A radial gradient that draws an ellipse defined by a collection of colors.

    • .ellipticalGradient(stops:center:startRadiusFraction:endRadiusFraction:) iOS macOS watchOS tvOS xrOS

      A radial gradient that draws an ellipse defined by a collection of color stops.

    • .indigo iOS macOS watchOS tvOS xrOS

      A context-dependent indigo color suitable for use in UI elements.

    • .mint iOS macOS watchOS tvOS xrOS

      A context-dependent mint color suitable for use in UI elements.

    • .opacity(_:) iOS macOS watchOS tvOS xrOS

      Returns a new style based on self that multiplies by the specified opacity when drawing.

    • .primary iOS macOS watchOS tvOS xrOS

      A shape style that maps to the first level of the current content style.

    • .quaternary iOS macOS watchOS tvOS xrOS

      A shape style that maps to the fourth level of the current content style.

    • .regularMaterial iOS macOS tvOS watchOS xrOS

      A material that’s somewhat translucent.

    • .secondary iOS macOS watchOS tvOS xrOS

      A shape style that maps to the second level of the current content style.

    • .selection iOS macOS xrOS

      A style used to visually indicate selection following platform conventional colors and behaviors.

    • .teal iOS macOS watchOS tvOS xrOS

      A context-dependent teal color suitable for use in UI elements.

    • .tertiary iOS macOS watchOS tvOS xrOS

      A shape style that maps to the third level of the current content style.

    • .thickMaterial iOS macOS tvOS watchOS xrOS

      A material that’s more opaque than translucent.

    • .thinMaterial iOS macOS tvOS watchOS xrOS

      A material that’s more translucent than opaque.

    • .tint iOS macOS watchOS tvOS xrOS

      A style that reflects the current tint color.

    • .ultraThickMaterial iOS macOS tvOS watchOS xrOS

      A mostly opaque material.

    • .ultraThinMaterial iOS macOS tvOS watchOS xrOS

      A mostly translucent material.

  • ToggleStyle:

    • .button iOS macOS watchOS xrOS

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

  • ToolbarItemPlacement:

    • .keyboard iOS macOS xrOS

      The item is placed in the keyboard section.

  • WidgetConfiguration:

SwiftUI 2.0 (2020) iOS 14|macOS 11|watchOS 7|tvOS 14|xrOS -2

Views SwiftUI 2.0  –  2020

  • CameraView HomeKit iOS watchOS tvOS Catalyst xrOS

    A SwiftUI view into which a video stream or an image snapshot is rendered.

  • ColorPicker iOS macOS xrOS

    A control used to select a color from the system color picker UI.

  • ContainerRelativeShape iOS macOS watchOS tvOS xrOS

    A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle.

  • DisclosureGroup iOS macOS xrOS

    A view that shows or hides another content view, based on the state of a disclosure control.

  • Gauge watchOS iOS macOS xrOS

    A view that shows a value within a range.

  • GroupBox macOS iOS xrOS

    A stylized view, with an optional label, that visually collects a logical grouping of content.

  • Label iOS macOS watchOS tvOS xrOS

    A standard label for user interface items, consisting of an icon with a title.

  • LazyHGrid iOS macOS watchOS tvOS xrOS

    A container view that arranges its child views in a grid that grows horizontally, creating items only as needed.

  • LazyHStack iOS macOS watchOS tvOS xrOS

    A view that arranges its children in a line that grows horizontally, creating items only as needed.

  • LazyVGrid iOS macOS watchOS tvOS xrOS

    A container view that arranges its child views in a grid that grows vertically, creating items only as needed.

  • LazyVStack iOS macOS watchOS tvOS xrOS

    A view that arranges its children in a line that grows vertically, creating items only as needed.

  • Link iOS macOS watchOS tvOS xrOS

    A control for navigating to a URL.

  • Map MapKit iOS macOS watchOS tvOS xrOS

    A view that displays an embedded map interface.

  • Menu iOS macOS tvOS xrOS

    A control for presenting a menu of actions.

  • NavigationView Deprecated iOS macOS tvOS watchOS xrOS

    A view for presenting a stack of views that represents a visible path in a navigation hierarchy.

    → Use NavigationStack and NavigationSplitView instead.

  • NowPlayingView WatchKit watchOS

    A view that displays the system’s Now Playing interface so that the user can control audio.

  • OutlineGroup iOS macOS xrOS

    A structure that computes views and disclosure groups on demand from an underlying collection of tree-structured, identified data.

  • ProgressView iOS macOS watchOS tvOS xrOS

    A view that shows the progress toward completion of a task.

  • SceneView SceneKit iOS macOS watchOS tvOS xrOS

    A SwiftUI view for displaying 3D SceneKit content.

  • ScrollViewReader iOS macOS watchOS tvOS xrOS

    A view that provides programmatic scrolling, by working with a proxy to scroll to known child views.

  • SignInWithAppleButton Authentication Services iOS macOS watchOS tvOS xrOS

    The view that creates the Sign in with Apple button for display.

  • SpriteView SpriteKit iOS macOS watchOS tvOS xrOS

    A SwiftUI view that renders a SpriteKit scene.

  • TabView iOS macOS tvOS watchOS xrOS

    A view that switches between multiple child views using interactive user interface elements.

  • TextEditor iOS macOS xrOS

    A view that can display and edit long-form text.

  • VideoPlayer AVKit iOS macOS watchOS tvOS xrOS

    A view that displays content from a player and a native user interface to control playback.

Scenes SwiftUI 2.0  –  2020

  • DocumentGroup iOS macOS xrOS

    A scene that enables support for opening, creating, and saving documents.

  • Settings macOS

    A scene that presents an interface for viewing and modifying an app’s settings.

  • WindowGroup iOS macOS watchOS tvOS xrOS

    A scene that presents a group of identically structured windows.

  • WKNotificationScene watchOS

    A scene which appears in response to receiving the specified category of remote or local notifications.

Commands SwiftUI 2.0  –  2020

  • CommandGroup iOS macOS xrOS

    Groups of controls that you can add to existing command menus.

  • CommandMenu iOS macOS xrOS

    Command menus are stand-alone, top-level containers for controls that perform related, app-specific commands.

  • EmptyCommands iOS macOS xrOS

    An empty group of commands.

  • SidebarCommands iOS macOS xrOS

    A built-in set of commands for manipulating window sidebars.

  • TextEditingCommands iOS macOS xrOS

    A built-in group of commands for searching, editing, and transforming selections of text.

  • TextFormattingCommands iOS macOS xrOS

    A built-in set of commands for transforming the styles applied to selections of text.

  • ToolbarCommands iOS macOS xrOS

    A built-in set of commands for manipulating window toolbars.

View Modifiers SwiftUI 2.0  –  2020

  • .accessibilityActivationPoint() iOS macOS watchOS tvOS xrOS

    The activation point for an element is the location assistive technologies use to initiate gestures.

  • .accessibilityAddTraits() iOS macOS watchOS tvOS xrOS

    Adds the given traits to the view.

  • .accessibilityHidden() iOS macOS watchOS tvOS xrOS

    Specifies whether to hide this view from system accessibility features.

  • .accessibilityHint() iOS macOS watchOS tvOS xrOS

    Communicates to the user what happens after performing the view’s action.

  • .accessibilityIdentifier() iOS macOS watchOS tvOS xrOS

    Uses the string you specify to identify the view.

  • .accessibilityIgnoresInvertColors() iOS macOS watchOS tvOS xrOS

    Sets whether this view should ignore the system Smart Invert setting.

  • .accessibilityInputLabels() iOS macOS watchOS tvOS xrOS

    Sets alternate input labels with which users identify a view.

  • .accessibilityLabel() iOS macOS watchOS tvOS xrOS

    Adds a label to the view that describes its contents.

  • .accessibilityLabeledPair() iOS macOS watchOS tvOS xrOS

    Pairs an accessibility element representing a label with the element for the matching content.

  • .accessibilityLinkedGroup() iOS macOS watchOS tvOS xrOS

    Links multiple accessibility elements so that the user can quickly navigate from one element to another, even when the elements are not near each other in the accessibility hierarchy.

  • .accessibilityRemoveTraits() iOS macOS watchOS tvOS xrOS

    Removes the given traits from this view.

  • .accessibilitySortPriority() iOS macOS watchOS tvOS xrOS

    Sets the sort priority order for this view’s accessibility element, relative to other elements at the same level.

  • .accessibilityValue() iOS macOS watchOS tvOS xrOS

    Adds a textual description of the value that the view contains.

  • .appStoreOverlay() StoreKit iOS xrOS

    Presents a StoreKit overlay when a given condition is true.

  • .contextMenu() iOS macOS watchOS tvOS xrOS

    Adds a context menu to a view.

  • .defaultAppStorage() iOS macOS watchOS tvOS xrOS

    The default store used by AppStorage contained within the view.

  • .fileExporter() iOS macOS xrOS

    Presents a system interface for exporting a collection of value type documents to files on disk.

  • .fileImporter() iOS macOS xrOS

    Presents a system interface for allowing the user to import an existing file.

  • .fileMover() iOS macOS xrOS

    Presents a system interface for allowing the user to move an existing file to a new location.

  • .focusedValue() iOS macOS watchOS tvOS xrOS

    Creates a new view that exposes the provided value to other views whose state depends on the focused view hierarchy.

  • .focusScope() watchOS tvOS macOS

    Creates a focus scope that SwiftUI uses to limit default focus preferences.

  • .fullScreenCover() iOS watchOS tvOS xrOS

    Presents a modal view that covers as much of the screen as possible using the binding you provide as a data source for the sheet’s content.

  • .gaugeStyle() watchOS iOS macOS xrOS

    Sets the style for gauges within this view.

  • .groupBoxStyle() iOS macOS xrOS

    Sets the style for group boxes within this view.

  • .handlesExternalEvents() iOS macOS xrOS

    Specifies a modifier indicating the Scene this View is in can handle matching incoming External Events.

  • .help() iOS macOS watchOS tvOS xrOS

    Adds help text to a view using a string that you provide.

  • .ignoresSafeArea() iOS macOS watchOS tvOS xrOS

    Expands the view out of its safe area.

  • .imageScale() iOS watchOS tvOS macOS xrOS

    Scales images within the view according to one of the relative sizes available including small, medium, and large images sizes.

  • .indexViewStyle() iOS tvOS watchOS xrOS

    Sets the style for the index view within the current environment.

  • .keyboardShortcut() iOS macOS xrOS

    Assigns a keyboard shortcut to the modified control.

  • .labelStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for labels within this view.

  • .listItemTint() iOS macOS watchOS tvOS xrOS

    Sets the tint effect associated with specific content in a list.

  • .matchedGeometryEffect() iOS macOS watchOS tvOS xrOS

    Defines a group of views with synchronized geometry using an identifier and namespace that you provide.

  • .menuStyle() iOS macOS tvOS xrOS

    Sets the style for menus within this view.

  • .navigationBarTitleDisplayMode() iOS watchOS xrOS

    Configures the title display mode for this view.

  • .navigationSubtitle() macOS Catalyst

    Configures the view’s subtitle for purposes of navigation.

  • .navigationTitle() iOS macOS watchOS tvOS xrOS

    Configures the view’s title for purposes of navigation.

  • .navigationViewStyle() Deprecated iOS macOS tvOS watchOS xrOS

    Sets the style for navigation views within this view.

    → Replace a styled NavigationView with a NavigationStack or NavigationSplitView.

  • .onChange() iOS macOS watchOS tvOS xrOS

    Adds a modifier for this view that fires an action when a specific value changes.

  • .onContinueUserActivity() iOS macOS watchOS tvOS xrOS

    Registers a handler to invoke when the view receives the specified activity type for the scene or window the view is in.

  • .onLongPressGesture() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when this view recognizes a long press gesture.

  • .onOpenURL() iOS macOS watchOS tvOS xrOS

    Registers a handler to invoke when the view receives a url for the scene or window the view is in.

  • .pageCommand() tvOS

    Steps a value through a range in response to page up or page down commands.

  • .preferredColorScheme() iOS watchOS tvOS macOS xrOS

    Sets the preferred color scheme for this presentation.

  • .prefersDefaultFocus() watchOS tvOS macOS

    Indicates that the view should receive focus by default for a given namespace.

  • .presentedWindowStyle() macOS

    Sets the style for windows created by interacting with this view.

  • .presentedWindowToolbarStyle() macOS

    Sets the style for the toolbar in windows created by interacting with this view.

  • .previewContext() iOS macOS watchOS tvOS xrOS

    Declares a context for the preview.

  • .progressViewStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for progress views in this view.

  • .quickLookPreview() QuickLook iOS macOS

    Presents a Quick Look preview of the contents of a single URL.

  • .redacted() iOS macOS watchOS tvOS xrOS

    Adds a reason to apply a redaction to this view hierarchy.

  • .signInWithAppleButtonStyle() AuthenticationServices iOS macOS watchOS tvOS

    Sets the style used for displaying the control (see SignInWithAppleButton.Style).

  • .tabItem() iOS macOS tvOS watchOS xrOS

    Sets the tab bar item associated with this view.

  • .tabViewStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for the tab view within the current environment.

  • .textCase() iOS macOS watchOS tvOS xrOS

    Sets a transform for the case of the text contained in this view when displayed.

  • .textContentType() iOS watchOS tvOS macOS xrOS

    Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on an iOS or tvOS device.

  • .toolbar() iOS macOS watchOS tvOS xrOS

    Populates the toolbar or navigation bar with the specified items.

  • .unredacted() iOS macOS watchOS tvOS xrOS

    Removes any reason to apply a redaction to this view hierarchy.

  • .userActivity() iOS macOS watchOS tvOS xrOS

    Advertises a user activity type.

  • .widgetURL() WidgetKit iOS macOS watchOS xrOS

    Sets the URL to open in the containing app when the user clicks the widget.

Scene Modifiers SwiftUI 2.0  –  2020

  • .commands() iOS macOS xrOS

    Adds commands to the scene.

  • .defaultAppStorage() iOS macOS watchOS tvOS xrOS

    The default store used by AppStorage contained within the scene and its view content.

  • .handlesExternalEvents() iOS macOS xrOS

    Specifies a modifier to indicate if this Scene can be used when creating a new Scene for the received External Event.

  • .onChange() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when the given value changes.

  • .windowStyle() macOS xrOS

    Sets the style for windows created by this scene.

  • .windowToolbarStyle() macOS

    Sets the style for the toolbar defined within this scene.

Environment Values SwiftUI 2.0  –  2020

  • \.accessibilityShowButtonShapes iOS macOS watchOS tvOS xrOS

    Whether the system preference for Show Button Shapes is enabled.

  • \.imageScale iOS watchOS tvOS macOS xrOS

    The image scale for this environment.

  • \.isFocused iOS macOS watchOS tvOS xrOS

    Returns whether the nearest focusable ancestor has focus.

  • \.openURL iOS macOS watchOS tvOS xrOS

    An action that opens a URL.

  • \.redactionReasons iOS macOS watchOS tvOS xrOS

    The current redaction reasons applied to the view hierarchy.

  • \.resetFocus watchOS tvOS macOS

    An action that requests the focus system to reevaluate default focus.

  • \.scenePhase iOS macOS watchOS tvOS xrOS

    The current phase of the scene.

  • \.textCase iOS macOS watchOS tvOS xrOS

    A stylistic override to transform the case of Text when displayed, using the environment’s locale.

  • \.widgetFamily WidgetKit iOS macOS watchOS xrOS

    The template of the widget — small, medium, or large.

Property Wrappers SwiftUI 2.0  –  2020

  • @AppStorage iOS macOS watchOS tvOS xrOS

    A property wrapper type that reflects a value from UserDefaults and invalidates a view on a change in value in that user default.

  • @FocusedBinding iOS macOS watchOS tvOS xrOS

    A convenience property wrapper for observing and automatically unwrapping state bindings from the focused view or one of its ancestors.

  • @FocusedValue iOS macOS watchOS tvOS xrOS

    A property wrapper for observing values from the focused view or one of its ancestors.

  • @Namespace iOS macOS watchOS tvOS xrOS

    A dynamic property type that allows access to a namespace defined by the persistent identity of the object containing the property (e.g. a view).

  • @NSApplicationDelegateAdaptor macOS

    A property wrapper type that you use to create an AppKit app delegate.

  • @ScaledMetric iOS macOS watchOS tvOS xrOS

    A dynamic property that scales a numeric value.

  • @SceneStorage iOS macOS watchOS tvOS xrOS

    A property wrapper type that reads and writes to persisted, per-scene storage.

  • @StateObject iOS macOS watchOS tvOS xrOS

    A property wrapper type that instantiates an observable object.

  • @UIApplicationDelegateAdaptor iOS tvOS xrOS

    A property wrapper type that you use to create a UIKit app delegate.

  • @WKApplicationDelegateAdaptor watchOS

    A property wrapper that is used in App to provide a delegate from WatchKit.

  • @WKExtensionDelegateAdaptor watchOS

    A property wrapper type that you use to create a WatchKit extension delegate.

Other Updates SwiftUI 2.0  –  2020

  • Color:

    • .cgColor Deprecated iOS macOS watchOS tvOS xrOS

      A Core Graphics representation of the color, if available.

  • DatePickerStyle:

    • .compact macOS Catalyst iOS xrOS

      A date picker style that displays the components in a compact, textual format.

    • .graphical macOS iOS xrOS

      A date picker style that displays an interactive calendar or clock.

  • Font:

    • .caption2 iOS macOS watchOS tvOS xrOS

      Create a font with the alternate caption text style.

    • .custom(_:fixedSize:) iOS macOS watchOS tvOS xrOS

      Create a custom font with the given name and a fixed size that does not scale with Dynamic Type.

    • .custom(_:size:relativeTo:) iOS macOS watchOS tvOS xrOS

      Create a custom font with the given name and size that scales relative to the given textStyle.

    • .leading(_:) iOS macOS watchOS tvOS xrOS

      Adjusts the line spacing of a font.

    • .title2 iOS macOS watchOS tvOS xrOS

      Create a font for second level hierarchical headings.

    • .title3 iOS macOS watchOS tvOS xrOS

      Create a font for third level hierarchical headings.

  • ListStyle:

    • .elliptical watchOS

      The list style that describes the behavior and appearance of an elliptical list.

    • .inset iOS macOS xrOS

      The list style that describes the behavior and appearance of an inset list.

    • .insetGrouped iOS xrOS

      The list style that describes the behavior and appearance of an inset grouped list.

    • .sidebar macOS iOS xrOS

      The list style that describes the behavior and appearance of a sidebar list.

  • PickerStyle:

    • .inline iOS macOS watchOS tvOS xrOS

      A PickerStyle where each option is displayed inline with other views in the current container.

    • .menu iOS macOS tvOS xrOS

      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.

  • PrimitiveButtonStyle:

    • .bordered macOS tvOS watchOS iOS xrOS

      A button style that applies standard border artwork based on the button’s context.

    • .card tvOS

      A button style that doesn’t pad the content, and applies a motion effect when a button has focus.

  • Shape:

    • .containerRelative iOS macOS watchOS tvOS xrOS

      A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle.

  • ShapeStyle:

    • .background iOS macOS watchOS tvOS xrOS

      The background style in the current context.

SwiftUI 1.0 (2019) iOS 13|macOS 10.15|watchOS 6|tvOS 13|xrOS -3

Views SwiftUI 1.0  –  2019

  • AngularGradient iOS macOS watchOS tvOS xrOS

    An angular gradient.

  • AnyView iOS macOS watchOS tvOS xrOS

    A type-erased view.

  • Button iOS macOS watchOS tvOS xrOS

    A control that initiates an action.

  • Capsule iOS macOS watchOS tvOS xrOS

    A capsule shape aligned inside the frame of the view containing it.

  • Circle iOS macOS watchOS tvOS xrOS

    A circle centered on the frame of the view containing it.

  • Color iOS macOS watchOS tvOS xrOS

    A representation of a color that adapts to a given context.

  • DatePicker iOS macOS watchOS xrOS

    A control for selecting an absolute date.

  • Divider iOS macOS watchOS tvOS xrOS

    A visual element that can be used to separate other content.

  • EditButton iOS xrOS

    A button that toggles the edit mode environment value.

  • Ellipse iOS macOS watchOS tvOS xrOS

    An ellipse aligned inside the frame of the view containing it.

  • EmptyView iOS macOS watchOS tvOS xrOS

    A view that doesn’t contain any content.

  • EquatableView iOS macOS watchOS tvOS xrOS

    A view type that compares itself against its previous value and prevents its child updating if its new value is the same as its old value.

  • ForEach iOS macOS watchOS tvOS xrOS

    A structure that computes views on demand from an underlying collection of identified data.

  • Form iOS macOS watchOS tvOS xrOS

    A container for grouping controls used for data entry, such as in settings or inspectors.

  • GeometryReader iOS macOS watchOS tvOS xrOS

    A container view that defines its content as a function of its own size and coordinate space.

  • Group iOS macOS watchOS tvOS xrOS

    A type that collects multiple instances of a content type — like views, scenes, or commands — into a single unit.

  • GroupBox macOS iOS xrOS

    A stylized view, with an optional label, that visually collects a logical grouping of content.

  • HSplitView macOS

    A layout container that arranges its children in a horizontal line and allows the user to resize them using dividers placed between them.

  • HStack iOS macOS watchOS tvOS xrOS

    A view that arranges its subviews in a horizontal line.

  • Image iOS macOS watchOS tvOS xrOS

    A view that displays an image.

  • LinearGradient iOS macOS watchOS tvOS xrOS

    A linear gradient.

  • List iOS macOS watchOS tvOS xrOS

    A container that presents rows of data arranged in a single column, optionally providing the ability to select one or more members.

  • MenuButton Deprecated macOS

    A button that displays a menu containing a list of choices when pressed.

    → Use Menu instead.

  • ModifiedContent iOS macOS watchOS tvOS xrOS

    A value with a modifier applied to it.

  • NavigationLink iOS macOS watchOS tvOS xrOS

    A view that controls a navigation presentation.

  • NavigationView Deprecated iOS macOS tvOS watchOS xrOS

    A view for presenting a stack of views that represents a visible path in a navigation hierarchy.

    → Use NavigationStack and NavigationSplitView instead.

  • OffsetShape iOS macOS watchOS tvOS xrOS

    A shape with a translation offset transform applied to it.

  • PasteButton macOS iOS xrOS

    A system button that reads items from the pasteboard and delivers it to a closure.

  • Path iOS macOS watchOS tvOS xrOS

    The outline of a 2D shape.

  • Picker iOS macOS watchOS tvOS xrOS

    A control for selecting from a set of mutually exclusive values.

  • RadialGradient iOS macOS watchOS tvOS xrOS

    A radial gradient.

  • Rectangle iOS macOS watchOS tvOS xrOS

    A rectangular shape aligned inside the frame of the view containing it.

  • RotatedShape iOS macOS watchOS tvOS xrOS

    A shape with a rotation transform applied to it.

  • RoundedRectangle iOS macOS watchOS tvOS xrOS

    A rectangular shape with rounded corners, aligned inside the frame of the view containing it.

  • ScaledShape iOS macOS watchOS tvOS xrOS

    A shape with a scale transform applied to it.

  • ScrollView iOS macOS watchOS tvOS xrOS

    A scrollable view.

  • Section iOS macOS watchOS tvOS xrOS

    A container view that you can use to add hierarchy to certain collection views.

  • SecureField iOS macOS watchOS tvOS xrOS

    A control into which the user securely enters private text.

  • Slider iOS macOS watchOS xrOS

    A control for selecting a value from a bounded linear range of values.

  • Spacer iOS macOS watchOS tvOS xrOS

    A flexible space that expands along the major axis of its containing stack layout, or on both axes if not contained in a stack.

  • Stepper iOS macOS watchOS xrOS

    A control that performs increment and decrement actions.

  • SubscriptionView iOS macOS watchOS tvOS xrOS

    A view that subscribes to a publisher with an action.

  • TabView iOS macOS tvOS watchOS xrOS

    A view that switches between multiple child views using interactive user interface elements.

  • Text iOS macOS watchOS tvOS xrOS

    A view that displays one or more lines of read-only text.

  • TextField iOS macOS watchOS tvOS xrOS

    A control that displays an editable text interface.

  • Toggle iOS macOS watchOS tvOS xrOS

    A control that toggles between on and off states.

  • TransformedShape iOS macOS watchOS tvOS xrOS

    A shape with an affine transform applied to it.

  • TupleView iOS macOS watchOS tvOS xrOS

    A View created from a swift tuple of View values.

  • VSplitView macOS

    A layout container that arranges its children in a vertical line and allows the user to resize them using dividers placed between them.

  • VStack iOS macOS watchOS tvOS xrOS

    A view that arranges its subviews in a vertical line.

  • ZStack iOS macOS watchOS tvOS xrOS

    A view that overlays its subviews, aligning them in both axes.

Classes SwiftUI 1.0  –  2019

View Modifiers SwiftUI 1.0  –  2019

  • .accentColor() Deprecated iOS macOS watchOS tvOS xrOS

    Sets the accent color for this view and the views it contains.

    → Use the asset catalog’s accent color or tint(_:) instead.

  • .accessibility() Deprecated iOS macOS watchOS tvOS xrOS

    Communicates to the user what happens after performing the view’s action.

    → Use accessibilityHint(_:) instead.

  • .accessibilityAction() iOS macOS watchOS tvOS xrOS

    Adds an accessibility action to the view. Actions allow assistive technologies, such as the VoiceOver, to interact with the view by invoking the action.

  • .accessibilityAdjustableAction() iOS macOS watchOS tvOS xrOS

    Adds an accessibility adjustable action to the view. Actions allow assistive technologies, such as the VoiceOver, to interact with the view by invoking the action.

  • .accessibilityElement() iOS macOS watchOS tvOS xrOS

    Creates a new accessibility element, or modifies the AccessibilityChildBehavior of the existing accessibility element.

  • .accessibilityScrollAction() iOS macOS watchOS tvOS xrOS

    Adds an accessibility scroll action to the view. Actions allow assistive technologies, such as the VoiceOver, to interact with the view by invoking the action.

  • .actionSheet() iOS watchOS tvOS xrOS

    Presents an action sheet using the given item as a data source for the sheet’s content.

  • .alert() iOS macOS watchOS tvOS xrOS

    Presents an alert when a given condition is true, using a text view for the title.

  • .alignmentGuide() iOS macOS watchOS tvOS xrOS

    Sets the view’s vertical alignment.

  • .allowsHitTesting() iOS macOS watchOS tvOS xrOS

    Configures whether this view participates in hit test operations.

  • .allowsTightening() iOS macOS watchOS tvOS xrOS

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

  • .anchorPreference() iOS macOS watchOS tvOS xrOS

    Sets a value for the specified preference key, the value is a function of a geometry value tied to the current coordinate space, allowing readers of the value to convert the geometry to their local coordinates.

  • .animation() iOS macOS watchOS tvOS xrOS

    Applies the given animation to this view when this view changes.

  • .aspectRatio() iOS macOS watchOS tvOS xrOS

    Constrains this view’s dimensions to the specified aspect ratio.

  • .autocapitalization() Deprecated iOS tvOS xrOS

    Sets whether to apply auto-capitalization to this view.

    → Use textInputAutocapitalization(_:) instead.

  • .autocorrectionDisabled() iOS macOS tvOS watchOS xrOS

    Sets whether to disable autocorrection for this view.

  • .background() iOS macOS watchOS tvOS xrOS

    Sets the view’s background to the default background style.

  • .backgroundPreferenceValue() iOS macOS watchOS tvOS xrOS

    Reads the specified preference value from the view, using it to produce a second view that is applied as the background of the original view.

  • .blendMode() iOS macOS watchOS tvOS xrOS

    Sets the blend mode for compositing this view with overlapping views.

  • .blur() iOS macOS watchOS tvOS xrOS

    Applies a Gaussian blur to this view.

  • .border() iOS macOS watchOS tvOS xrOS

    Adds a border to this view with the specified style and width.

  • .brightness() iOS macOS watchOS tvOS xrOS

    Brightens this view by the specified amount.

  • .buttonStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for buttons within this view to a button style with a custom appearance and custom interaction behavior.

  • .clipped() iOS macOS watchOS tvOS xrOS

    Clips this view to its bounding rectangular frame.

  • .clipShape() iOS macOS watchOS tvOS xrOS

    Sets a clipping shape for this view.

  • .colorInvert() iOS macOS watchOS tvOS xrOS

    Inverts the colors in this view.

  • .colorMultiply() iOS macOS watchOS tvOS xrOS

    Adds a color multiplication effect to this view.

  • .colorScheme() Deprecated iOS macOS watchOS tvOS xrOS

    Sets this view’s color scheme.

    → Use preferredColorScheme(_:) instead.

  • .compositingGroup() iOS macOS watchOS tvOS xrOS

    Wraps this view in a compositing group.

  • .contentShape() iOS macOS watchOS tvOS xrOS

    Defines the content shape for hit testing.

  • .contextMenu() iOS macOS watchOS tvOS xrOS

    Adds a context menu to a view.

  • .contrast() iOS macOS watchOS tvOS xrOS

    Sets the contrast and separation between similar colors in this view.

  • .controlSize() macOS iOS watchOS xrOS

    Sets the size for controls within this view.

  • .coordinateSpace() iOS macOS watchOS tvOS xrOS

    Assigns a name to the view’s coordinate space, so other code can operate on dimensions like points and sizes relative to the named space.

  • .cornerRadius() Deprecated iOS macOS watchOS tvOS xrOS

    Clips this view to its bounding frame, with the specified corner radius.

    → Use clipShape(_:style:) or fill(style:) instead.

  • .datePickerStyle() iOS macOS watchOS xrOS

    Sets the style for date pickers within this view.

  • .defaultWheelPickerItemHeight() watchOS xrOS

    Sets the default wheel-style picker item height.

  • .deleteDisabled() iOS macOS watchOS tvOS xrOS

    Adds a condition for whether the view’s view hierarchy is deletable.

  • .digitalCrownRotation() watchOS

    Tracks Digital Crown rotations by updating the specified binding.

  • .disableAutocorrection() Deprecated iOS macOS tvOS watchOS xrOS

    Sets whether to disable autocorrection for this view.

    → Use autocorrectionDisabled(_:) instead.

  • .disabled() iOS macOS watchOS tvOS xrOS

    Adds a condition that controls whether users can interact with this view.

  • .drawingGroup() iOS macOS watchOS tvOS xrOS

    Composites this view’s contents into an offscreen image before final display.

  • .edgesIgnoringSafeArea() Deprecated iOS macOS watchOS tvOS xrOS

    Changes the view’s proposed area to extend outside the screen’s safe areas.

    → Use ignoresSafeArea(_:edges:) instead.

  • .environment() iOS macOS watchOS tvOS xrOS

    Sets the environment value of the specified key path to the given value.

  • .environmentObject() iOS macOS watchOS tvOS xrOS

    Supplies an ObservableObject to a view subhierarchy.

  • .fixedSize() iOS macOS watchOS tvOS xrOS

    Fixes this view at its ideal size.

  • .flipsForRightToLeftLayoutDirection() iOS macOS watchOS tvOS xrOS

    Sets whether this view mirrors its contents horizontally when the layout direction is right-to-left.

  • .focusable() macOS watchOS tvOS iOS xrOS

    Specifies if the view is focusable.

  • .font() iOS macOS watchOS tvOS xrOS

    Sets the default font for text in this view.

  • .foregroundColor() Deprecated iOS macOS watchOS tvOS xrOS

    Sets the color of the foreground elements displayed by this view.

    → Use foregroundStyle(_:) instead.

  • .frame() iOS macOS watchOS tvOS xrOS

    Positions this view within an invisible frame.

  • .gesture() iOS macOS watchOS tvOS xrOS

    Attaches a gesture to the view with a lower precedence than gestures defined by the view.

  • .grayscale() iOS macOS watchOS tvOS xrOS

    Adds a grayscale effect to this view.

  • .hidden() iOS macOS watchOS tvOS xrOS

    Hides this view unconditionally.

  • .highPriorityGesture() iOS macOS watchOS tvOS xrOS

    Attaches a gesture to the view with a higher precedence than gestures defined by the view.

  • .horizontalRadioGroupLayout() macOS

    Sets the style for radio group style pickers within this view to be horizontally positioned with the radio buttons inside the layout.

  • .hoverEffect() iOS tvOS xrOS

    Applies a hover effect to this view.

  • .hueRotation() iOS macOS watchOS tvOS xrOS

    Applies a hue rotation effect to this view.

  • .id() iOS macOS watchOS tvOS xrOS

    Binds a view’s identity to the given proxy value.

  • .imageScale() iOS watchOS tvOS macOS xrOS

    Scales images within the view according to one of the relative sizes available including small, medium, and large images sizes.

  • .itemProvider() iOS macOS watchOS tvOS xrOS

    Provides a closure that vends the drag representation to be used for a particular data element.

  • .keyboardType() iOS tvOS xrOS

    Sets the keyboard type for this view.

  • .labelsHidden() iOS macOS watchOS tvOS xrOS

    Hides the labels of any controls contained within this view.

  • .layoutPriority() iOS macOS watchOS tvOS xrOS

    Sets the priority by which a parent layout should apportion space to this child.

  • .lineLimit() iOS macOS watchOS tvOS xrOS

    Sets the maximum number of lines that text can occupy in this view.

  • .lineSpacing() iOS macOS watchOS tvOS xrOS

    Sets the amount of space between lines of text in this view.

  • .listRowBackground() iOS macOS watchOS tvOS xrOS

    Places a custom background view behind a list row item.

  • .listRowInsets() iOS macOS watchOS tvOS xrOS

    Applies an inset to the rows in a list.

  • .listRowPlatterColor() Deprecated watchOS

    Sets the color that the system applies to the row background when this view is placed in a list.

    → Use listItemTint(_:) instead.

  • .listStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for lists within this view.

  • .luminanceToAlpha() iOS macOS watchOS tvOS xrOS

    Adds a luminance to alpha effect to this view.

  • .mask() iOS macOS watchOS tvOS xrOS

    Masks this view using the alpha channel of the given view.

  • .menuButtonStyle() Deprecated macOS

    Sets the style for menu buttons within this view.

    → Use menuStyle(_:) instead.

  • .minimumScaleFactor() iOS macOS watchOS tvOS xrOS

    Sets the minimum amount that text in this view scales down to fit in the available space.

  • .modifier() iOS macOS watchOS tvOS xrOS

    Applies a modifier to a view and returns a new view.

  • .moveDisabled() iOS macOS watchOS tvOS xrOS

    Adds a condition for whether the view’s view hierarchy is movable.

  • .multilineTextAlignment() iOS macOS watchOS tvOS xrOS

    Sets the alignment of a text view that contains multiple lines of text.

  • .navigationBarBackButtonHidden() iOS watchOS tvOS macOS xrOS

    Hides the navigation bar back button for the view.

  • .navigationBarHidden() Deprecated iOS watchOS tvOS xrOS

    Hides the navigation bar for this view.

    → Use toolbar(_:for:) with the Visibility.hidden visibility and the navigationBar placement instead.

  • .navigationBarItems() Deprecated iOS tvOS xrOS

    Sets the navigation bar items for this view.

    → Use toolbar(content:) with navigationBarLeading placement.

  • .navigationBarTitle() Deprecated iOS watchOS tvOS xrOS

    Sets the title in the navigation bar for this view.

    → Use navigationTitle(_:) instead.

  • .navigationViewStyle() Deprecated iOS macOS tvOS watchOS xrOS

    Sets the style for navigation views within this view.

    → Replace a styled NavigationView with a NavigationStack or NavigationSplitView.

  • .offset() iOS macOS watchOS tvOS xrOS

    Offset this view by the horizontal and vertical amount specified in the offset parameter.

  • .onAppear() iOS macOS watchOS tvOS xrOS

    Adds an action to perform before this view appears.

  • .onCommand() macOS

    Adds an action to perform in response to the given selector.

  • .onCopyCommand() macOS

    Adds an action to perform in response to the system’s Copy command.

  • .onCutCommand() macOS

    Adds an action to perform in response to the system’s Cut command.

  • .onDeleteCommand() macOS

    Adds an action to perform in response to the system’s Delete command, or pressing either the ⌫ (backspace) or ⌦ (forward delete) keys while the view has focus.

  • .onDisappear() iOS macOS watchOS tvOS xrOS

    Adds an action to perform after this view disappears.

  • .onDrag() iOS macOS xrOS

    Activates this view as the source of a drag and drop operation.

  • .onDrop() iOS macOS xrOS

    Defines the destination of a drag and drop operation using behavior controlled by the delegate that you provide.

  • .onExitCommand() macOS tvOS

    Sets up an action that triggers in response to receiving the exit command while the view has focus.

  • .onHover() iOS macOS xrOS

    Adds an action to perform when the user moves the pointer over or away from the view’s frame.

  • .onLongPressGesture() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when this view recognizes a long press gesture.

  • .onMoveCommand() macOS tvOS

    Adds an action to perform in response to a move command, like when the user presses an arrow key on a Mac keyboard, or taps the edge of the Siri Remote when controlling an Apple TV.

  • .onPasteCommand() macOS

    Adds an action to perform in response to the system’s Paste command.

  • .onPlayPauseCommand() tvOS

    Adds an action to perform in response to the system’s Play/Pause command.

  • .onPreferenceChange() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when the specified preference key’s value changes.

  • .onReceive() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when this view detects data emitted by the given publisher.

  • .onTapGesture() iOS macOS watchOS tvOS xrOS

    Adds an action to perform when this view recognizes a tap gesture.

  • .opacity() iOS macOS watchOS tvOS xrOS

    Sets the transparency of this view.

  • .overlay() iOS macOS watchOS tvOS xrOS

    Layers the views that you specify in front of this view.

  • .overlayPreferenceValue() iOS macOS watchOS tvOS xrOS

    Reads the specified preference value from the view, using it to produce a second view that is applied as an overlay to the original view.

  • .padding() iOS macOS watchOS tvOS xrOS

    Adds a specific padding amount to each edge of this view.

  • .pickerStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for pickers within this view.

  • .popover() iOS macOS xrOS

    Presents a popover using the given item as a data source for the popover’s content.

  • .position() iOS macOS watchOS tvOS xrOS

    Positions the center of this view at the specified point in its parent’s coordinate space.

  • .preference() iOS macOS watchOS tvOS xrOS

    Sets a value for the given preference.

  • .preferredColorScheme() iOS watchOS tvOS macOS xrOS

    Sets the preferred color scheme for this presentation.

  • .previewDevice() iOS macOS watchOS tvOS xrOS

    Overrides the device for a preview.

  • .previewDisplayName() iOS macOS watchOS tvOS xrOS

    Sets a user visible name to show in the canvas for a preview.

  • .previewLayout() iOS macOS watchOS tvOS xrOS

    Overrides the size of the container for the preview.

  • .projectionEffect() iOS macOS watchOS tvOS xrOS

    Applies a projection transformation to this view’s rendered output.

  • .rotation3DEffect() iOS macOS watchOS tvOS xrOS

    Rotates this view’s rendered output in three dimensions around the given axis of rotation.

  • .rotationEffect() iOS macOS watchOS tvOS xrOS

    Rotates this view’s rendered output around the specified point.

  • .saturation() iOS macOS watchOS tvOS xrOS

    Adjusts the color saturation of this view.

  • .scaledToFill() iOS macOS watchOS tvOS xrOS

    Scales this view to fill its parent.

  • .scaledToFit() iOS macOS watchOS tvOS xrOS

    Scales this view to fit its parent.

  • .scaleEffect() iOS macOS watchOS tvOS xrOS

    Scales this view’s rendered output by the given vertical and horizontal size amounts, relative to an anchor point.

  • .shadow() iOS macOS watchOS tvOS xrOS

    Adds a shadow to this view.

  • .sheet() iOS macOS watchOS tvOS xrOS

    Presents a sheet using the given item as a data source for the sheet’s content.

  • .simultaneousGesture() iOS macOS watchOS tvOS xrOS

    Attaches a gesture to the view to process simultaneously with gestures defined by the view.

  • .statusBar() Deprecated iOS xrOS

    Sets the visibility of the status bar.

    → Use statusBarHidden(_:) instead.

  • .statusBarHidden() iOS xrOS

    Sets the visibility of the status bar.

  • .tabItem() iOS macOS tvOS watchOS xrOS

    Sets the tab bar item associated with this view.

  • .tag() iOS macOS watchOS tvOS xrOS

    Sets the unique tag value of this view.

  • .textContentType() iOS watchOS tvOS macOS xrOS

    Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on an iOS or tvOS device.

  • .textFieldStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for text fields within this view.

  • .toggleStyle() iOS macOS watchOS tvOS xrOS

    Sets the style for toggles in a view hierarchy.

  • .touchBar() macOS

    Sets the Touch Bar content to be shown in the Touch Bar when applicable.

  • .touchBarCustomizationLabel() macOS

    Sets a user-visible string that identifies the view’s functionality.

  • .touchBarItemPresence() macOS

    Sets the behavior of the user-customized view.

  • .touchBarItemPrincipal() macOS

    Sets principal views that have special significance to this Touch Bar.

  • .transaction() iOS macOS watchOS tvOS xrOS

    Applies the given transaction mutation function to all animations used within the view.

  • .transformAnchorPreference() iOS macOS watchOS tvOS xrOS

    Sets a value for the specified preference key, the value is a function of the key’s current value and a geometry value tied to the current coordinate space, allowing readers of the value to convert the geometry to their local coordinates.

  • .transformEffect() iOS macOS watchOS tvOS xrOS

    Applies an affine transformation to this view’s rendered output.

  • .transformEnvironment() iOS macOS watchOS tvOS xrOS

    Transforms the environment value of the specified key path with the given function.

  • .transformPreference() iOS macOS watchOS tvOS xrOS

    Applies a transformation to a preference value.

  • .transition() iOS macOS watchOS tvOS xrOS

    Associates a transition with the view.

  • .truncationMode() iOS macOS watchOS tvOS xrOS

    Sets the truncation mode for lines of text that are too long to fit in the available space.

  • .zIndex() iOS macOS watchOS tvOS xrOS

    Controls the display order of overlapping views.

Environment Values SwiftUI 1.0  –  2019

  • \.accessibilityDifferentiateWithoutColor iOS macOS watchOS tvOS xrOS

    Whether the system preference for Differentiate without Color is enabled.

  • \.accessibilityEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the user has enabled an assistive technology.

  • \.accessibilityInvertColors iOS macOS watchOS tvOS xrOS

    Whether the system preference for Invert Colors is enabled.

  • \.accessibilityReduceMotion iOS macOS watchOS tvOS xrOS

    Whether the system preference for Reduce Motion is enabled.

  • \.accessibilityReduceTransparency iOS macOS watchOS tvOS xrOS

    Whether the system preference for Reduce Transparency is enabled.

  • \.allowsTightening iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether inter-character spacing should tighten to fit the text into the available space.

  • \.autocorrectionDisabled iOS macOS tvOS watchOS xrOS

    A Boolean value that determines whether the view hierarchy has auto-correction enabled.

  • \.calendar iOS macOS watchOS tvOS xrOS

    The current calendar that views should use when handling dates.

  • \.colorScheme iOS macOS watchOS tvOS xrOS

    The color scheme of this environment.

  • \.colorSchemeContrast iOS macOS watchOS tvOS xrOS

    The contrast associated with the color scheme of this environment.

  • \.controlActiveState macOS

    The active state of controls in the view.

  • \.controlSize macOS iOS watchOS xrOS

    The size to apply to controls within a view.

  • \.defaultMinListHeaderHeight iOS macOS watchOS tvOS xrOS

    The default minimum height of a header in a list.

  • \.defaultMinListRowHeight iOS macOS watchOS tvOS xrOS

    The default minimum height of a row in a list.

  • \.defaultWheelPickerItemHeight watchOS

    The default height of an item in a wheel-style picker, such as a date picker.

  • \.description iOS macOS watchOS tvOS xrOS

    A string that represents the contents of the environment values instance.

  • \.disableAutocorrection Deprecated iOS macOS tvOS watchOS xrOS

    A Boolean value that determines whether the view hierarchy has auto-correction enabled.

  • \.displayScale iOS macOS watchOS tvOS xrOS

    The display scale of this environment.

  • \.editMode iOS tvOS xrOS

    An indication of whether the user can edit the contents of a view associated with this environment.

  • \.font iOS macOS watchOS tvOS xrOS

    The default font of this environment.

  • \.horizontalSizeClass iOS macOS watchOS tvOS xrOS

    The horizontal size class of this environment.

  • \.imageScale iOS watchOS tvOS macOS xrOS

    The image scale for this environment.

  • \.isEnabled iOS macOS watchOS tvOS xrOS

    A Boolean value that indicates whether the view associated with this environment allows user interaction.

  • \.layoutDirection iOS macOS watchOS tvOS xrOS

    The layout direction associated with the current environment.

  • \.legibilityWeight iOS macOS watchOS tvOS xrOS

    The font weight to apply to text.

  • \.lineLimit iOS macOS watchOS tvOS xrOS

    The maximum number of lines that text can occupy in a view.

  • \.lineSpacing iOS macOS watchOS tvOS xrOS

    The distance in points between the bottom of one line fragment and the top of the next.

  • \.locale iOS macOS watchOS tvOS xrOS

    The current locale that views should use.

  • \.managedObjectContext iOS macOS watchOS tvOS xrOS

  • \.minimumScaleFactor iOS macOS watchOS tvOS xrOS

    The minimum permissible proportion to shrink the font size to fit the text into the available space.

  • \.multilineTextAlignment iOS macOS watchOS tvOS xrOS

    An environment value that indicates how a text view aligns its lines when the content wraps or contains newlines.

  • \.pixelLength iOS macOS watchOS tvOS xrOS

    The size of a pixel on the screen.

  • \.presentationMode Deprecated iOS macOS watchOS tvOS xrOS

    A binding to the current presentation mode of the view associated with this environment.

    → Use isPresented or dismiss instead.

  • \.sizeCategory Deprecated iOS macOS watchOS tvOS xrOS

    The size of content.

    → Use dynamicTypeSize instead.

  • \.timeZone iOS macOS watchOS tvOS xrOS

    The current time zone that views should use when handling dates.

  • \.truncationMode iOS macOS watchOS tvOS xrOS

    A value that indicates how the layout truncates the last line of text to fit into the available space.

  • \.undoManager iOS macOS watchOS tvOS xrOS

    The undo manager used to register a view’s undo operations.

  • \.verticalSizeClass iOS macOS watchOS tvOS xrOS

    The vertical size class of this environment.

Property Wrappers SwiftUI 1.0  –  2019

  • @Binding iOS macOS watchOS tvOS xrOS

    A property wrapper type that can read and write a value owned by a source of truth.

  • @Environment iOS macOS watchOS tvOS xrOS

    A property wrapper that reads a value from a view’s environment.

  • @EnvironmentObject iOS macOS watchOS tvOS xrOS

    A property wrapper type for an observable object supplied by a parent or ancestor view.

  • @FetchRequest iOS macOS watchOS tvOS xrOS

    A property wrapper type that retrieves entities from a Core Data persistent store.

  • @GestureState iOS macOS watchOS tvOS xrOS

    A property wrapper type that updates a property while the user performs a gesture and resets the property back to its initial state when the gesture ends.

  • @ObservedObject iOS macOS watchOS tvOS xrOS

    A property wrapper type that subscribes to an observable object and invalidates a view whenever the observable object changes.

  • @State iOS macOS watchOS tvOS xrOS

    A property wrapper type that can read and write a value managed by SwiftUI.