One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

VStack

struct · iOS 13.0+ · SDK 27.1

@frozen nonisolated struct VStack<Content> where Content : View

A view that arranges its subviews in a vertical line. Unlike ``LazyVStack``, which only renders the views when your app needs to display them, a `VStack` renders the views all at once, regardless of whether they are on- or offscreen. Use the regular `VStack` when you have a small number of subviews or don't want the delayed rendering behavior of the "lazy" version. The following example shows a simple vertical stack of 10 text views: var body: some View { VStack( alignment: .leading, spacing: 10 ) { ForEach( 1...10, id: \.self ) { Text("Item \($0)") } } } ![Ten text views, named Item 1 through Item 10, arranged in a vertical line.](SwiftUI-VStack-simple.png) > Note: If you need a vertical stack that conforms to the ``Layout`` protocol, like when you want to create a conditional layout using ``AnyLayout``, use ``VStackLayout`` instead.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

VStack.init(alignment:spacing:content:)

callback cannot propagate synchronous failure

All SwiftUICore types →