What's the purpose of Vstack when we actually don't need it ??

https://www.swift.org/getting-started/swiftui/

This training page let you understand the Vstack purpose but if you look at my own way of doing it I Made it disappear ??? is this a new release from Swift ?

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Why not try…")
               .font(.largeTitle.bold())
        Spacer()
        Circle()
            .fill(.blue)
            .padding()
            .overlay(
            Image(systemName: "figure.archery")
                .font(.system(size: 144))
                .foregroundColor(.white)
        )
        Text("Archery!")
            .font(.title)
        
        Spacer()
    }
}

#Preview {
    ContentView()
}
Answered by SGSHARPSEB in 780259022

Sorry guys I should have finish the tutorial and it is actually useful if you want to change a full vstack with animation ;) got my answer it’s useful if you want to group things and make any animate it.

if someone want to add something please add , today that’s the only purpose I see thanks to this tutorial.

as for the Hstack agree that one is useful.

Can you show preview images of ContentView with and without VStack?

If nothing else, it lets you put a group of vertically stacked views inside a horizontal group, for instance.

Accepted Answer

Sorry guys I should have finish the tutorial and it is actually useful if you want to change a full vstack with animation ;) got my answer it’s useful if you want to group things and make any animate it.

if someone want to add something please add , today that’s the only purpose I see thanks to this tutorial.

as for the Hstack agree that one is useful.

It may also let you easily apply an in itializer through onAppear modifier to the VStack.

What's the purpose of Vstack when we actually don't need it ??
 
 
Q