Contents

View fundamentals

Define the visual elements of your app using a hierarchy of views.

Overview

Views are the building blocks that you use to declare your app’s user interface. Each view contains a description of what to display for a given state. Every bit of your app that’s visible to the user derives from the description in a view, and any type that conforms to the View protocol can act as a view in your app.

[Image]

Compose a custom view by combining built-in views that SwiftUI provides with other custom views that you create in your view’s body computed property. Configure views using the view modifiers that SwiftUI provides, or by defining your own view modifiers using the ViewModifier protocol and the modifier(_:) method.

Topics

Creating a view

Modifying a view

Responding to view life cycle updates

Managing the view hierarchy

Supporting view types

See Also

Views