Structures

The following structures are available globally.

UIViewControllerRepresentable

UIViewRepresentable

Environment

  • Contains the Environment values set by the framework.

    See more

    Declaration

    Swift

    public struct EnvironmentValues

Context

  • Contains merged view values and contextual information while traversing a view hierarchy.

    Declaration

    Swift

    public struct Context
  • Contains originating attributes of a view update transaction

    See more

    Declaration

    Swift

    public struct Transaction
    extension Transaction: Hashable

Public Types

  • A type that describes properties of an animation

    See more

    Declaration

    Swift

    public struct Animation
    extension Animation: Hashable
  • This type will handle events of a user’s tap gesture.

    See more

    Declaration

    Swift

    public struct TapGesture : Gesture, ExecutableGesture
  • This type will handle events of a user’s drag gesture.

    See more

    Declaration

    Swift

    public struct DragGesture : Gesture, ExecutableGesture
  • The inset distances for the sides of a rectangle.

    See more

    Declaration

    Swift

    public struct EdgeInsets : Equatable
  • A type that specifies the alignment of the content inside its container.

    See more

    Declaration

    Swift

    public struct Alignment : Equatable
  • A proxy for access to the size and coordinate space (for anchor resolution) of the container view.

    See more

    Declaration

    Swift

    public struct GeometryProxy : Hashable
  • A type that represents the presentation mode of a view.

    See more

    Declaration

    Swift

    public struct PresentationMode
  • A type that represents a font and its configuration.

    See more

    Declaration

    Swift

    public struct Font
  • A type that contains the configuration of a button style.

    See more

    Declaration

    Swift

    public struct ButtonStyleConfiguration
  • A type representing a geometry angle.

    See more

    Declaration

    Swift

    public struct Angle : Hashable
  • A plain list style to be a applied to a List.

    See more

    Declaration

    Swift

    public struct PlainListStyle : ListStyle
  • A grouped list style to be a applied to a List.

    See more

    Declaration

    Swift

    public struct GroupedListStyle : ListStyle
  • An inset grouped list style to be a applied to a List.

    See more

    Declaration

    Swift

    @available(iOS 13.0, *)
    @available(macOS, unavailable)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    public struct InsetGroupedListStyle : ListStyle
  • A type that represents a transition used by a view when being added or removed from a hierarchy.

    See more

    Declaration

    Swift

    public struct AnyTransition
  • Type that represents a system alert. Use it to customize the texts and actions that will be shown in the alert.

    See more

    Declaration

    Swift

    public struct Alert
  • Type that represents a system action sheet. Use it to customize the texts and actions that will be shown in the action sheet.

    See more

    Declaration

    Swift

    @available(macOS, unavailable)
    public struct ActionSheet
  • A container whose view content children will be presented as a menu items in a contextual menu after completion of the standard system gesture.

    The controls contained in a ContextMenu should be related to the context they are being shown from.

    See also

    View.contextMenu, which attaches a ContextMenu to a View.
    See more

    Declaration

    Swift

    @available(tvOS, unavailable)
    public struct ContextMenu
  • Represents the values of a view, which can be customized by view modifiers. For internal use only.

    See more

    Declaration

    Swift

    public struct ViewValues : AnimatedViewValuesHolder
  • A view that creates views based on data. This view itself has no visual representation. Adding a background to this view, for example, will have no effect.

    See more

    Declaration

    Swift

    public struct ForEach<Data, ID, Content> : View where Data : RandomAccessCollection, ID : Hashable, Content : View
  • A group is a convenience view that groups multiple views into a single view. This view has no visual representation and does not affect the subviews layouts in any way.

    Use this when the number of elements inside a ViewBuilder exceeds the limit.

    See more

    Declaration

    Swift

    public struct Group : View, ViewGrouper
  • This view arranges subviews horizontally.

    See more

    Declaration

    Swift

    public struct HStack : View
    extension HStack: Renderable
  • Declaration

    Swift

    public struct ListVisibleRow
  • A list of elements that creates each subview on demand.

    See more

    Declaration

    Swift

    public struct List<Content, Data, ID> : View where Content : View, ID : Hashable
    extension List: Renderable
  • Creates a view that can scroll its subviews. Unlike a List, all subviews are created together with this view.

    See more

    Declaration

    Swift

    public struct ScrollView : View
    extension ScrollView: Renderable
  • A tab view that is shown at the bottom of the screen.

    Important: This view will add a tab view at the root screen in the application.

    See more

    Declaration

    Swift

    @available(watchOS, unavailable)
    public struct TabView : View
    extension TabView: Renderable
  • This view arranges subviews vertically.

    See more

    Declaration

    Swift

    public struct VStack : View
    extension VStack: Renderable
  • This view arranges subviews one in front of the other, using the z axis.

    See more

    Declaration

    Swift

    public struct ZStack : View
    extension ZStack: Renderable
  • A view that can be tapped by the user to trigger some action.

    See more

    Declaration

    Swift

    public struct Button : View
    extension Button: Renderable
  • A view that displays a wheel-style date picker that allows selecting a date in the range.

    See more

    Declaration

    Swift

    public struct DatePicker : View
    extension DatePicker: Renderable
  • A view into which the user securely enters private text.

    See more

    Declaration

    Swift

    public struct SecureField : View
  • A view that displays a range of values, and a knob that allows selecting a value in the range.

    See more

    Declaration

    Swift

    public struct Slider : View
    extension Slider: Renderable
  • A view that allows text input in one line.

    See more

    Declaration

    Swift

    public struct TextField<T> : View
    extension TextField: Renderable
  • A view that can be turned on and off.

    See more

    Declaration

    Swift

    public struct Toggle : View
    extension Toggle: Renderable

Renderable Views

Builder Views

  • Declaration

    Swift

    public struct OptionalView : View
  • Declaration

    Swift

    public struct TupleView : View, ViewGrouper
  • A view that adds navigation capabilities to a whole view hierarchy. Add only one NavigationView per view hierarchy.

    By adding a NavigationView, a navigation bar will be shown by default.

    See more

    Declaration

    Swift

    public struct NavigationView : View
    extension NavigationView: Renderable
  • This view will perform navigation when triggered by the user. The behavior of this view is same as a Button, but the action is predefined to navigate to a specified View.

    See more

    Declaration

    Swift

    public struct NavigationLink : View
    extension NavigationLink: Renderable
  • A view that represents a color.

    By default, a Color that is directly rendered in a view hierarchy will expand both horizontally and vertically infinitely as much as its parent view allows it to.

    See more

    Declaration

    Swift

    public struct Color : View
    extension Color: Renderable
  • A view that creates a line divider for dividing content.

    When used inside a VStack, the divider will display a horizontal line.

    When used inside a HStack, the divider will display a vertical line.

    Otherwise, the divider will always display a horizontal line.

    See more

    Declaration

    Swift

    public struct Divider : View
    extension Divider: Renderable
  • A container view that provides its children a GeometryProxy value with it’s own frame.

    By default this view’s dimensions are flexible.

    See more

    Declaration

    Swift

    public struct GeometryReader : View
  • A view that renders an image.

    See more

    Declaration

    Swift

    public struct Image : View
    extension Image: Renderable
  • A view that displays a list of values, from which one can be selected.

    By Default a picker view style will be used. If you want to use a different style, modify the view with the .pickerStyle(_) method.

    See more

    Declaration

    Swift

    public struct Picker : View
    extension Picker: Renderable
  • A Picker style that renders a segmented control view.

    See more

    Declaration

    Swift

    public struct SegmentedPickerStyle : PickerStyle
  • A view that expands infinitely as much as it is allowed by its parent view. Spacers should only be used inside HStack or VStack, otherwise it’s behavior will be undefined.

    When inside a HStack, the spacer will expand horizontally.

    When inside a VStack, the spacer will expand vertically.

    See more

    Declaration

    Swift

    public struct Spacer : View
    extension Spacer: Renderable
  • A view that represents a read only text

    See more

    Declaration

    Swift

    public struct Text : View
    extension Text: Renderable
  • A view that represents a Capsule shape.

    See more

    Declaration

    Swift

    public struct Capsule : Shape
  • A view that represents a Circle shape.

    See more

    Declaration

    Swift

    public struct Circle : Shape
  • A view that represents a Ellipse shape.

    See more

    Declaration

    Swift

    public struct Ellipse : Shape
  • A view that represents a Rectangle shape.

    See more

    Declaration

    Swift

    public struct Rectangle : Shape
  • A view that represents a RoundedRectangle shape.

    See more

    Declaration

    Swift

    public struct RoundedRectangle : Shape
  • Type that hold style properties of a stroke.

    See more

    Declaration

    Swift

    public struct StrokeStyle : Equatable