I have a dynamic SwiftUI view where I pass information through parameter. After, I try to make copies of the view using ForEach loop. The views appear as usual vertically in a Stack. However, I would like to present the all views in three different lines. Could anyone please present a efficient solution?
I want this design:
But I have got this:
My code:
struct AllDaysView: View {
@Binding var hasMenuShown: Bool
var days: [String] = NextDaysView().days
var body: some View {
VStack {
MenuBarView(hasMenuShown: $hasMenuShown)
ForecastButtonsView()
HStack {
ForEach(days, id: \.self) { day in
SingleDaySummaryView(day: day)
}
}
Spacer()
}
}
}

