krz/daybyday
iOS app for children to learn days of the week, months, and seasons with audio assist.
clone: git clone https://gitbay.org/krz/daybyday.git
v1.3.2: DayByDay/DaysOfWeekView.swift · raw
1//
2// DaysOfWeekView.swift
3// DayByDay
4//
5
6import SwiftUI
7
8/// Displays all seven days of the week as large, tappable cards in a scrollable grid.
9/// Adapts between 1 and 2 columns depending on available width.
10struct DaysOfWeekView: View {
11 private let columns = [
12 GridItem(.adaptive(minimum: 300, maximum: 500), spacing: 24)
13 ]
14
15 var body: some View {
16 ScrollView {
17 LazyVGrid(columns: columns, spacing: 24) {
18 ForEach(DayOfWeek.allCases) { day in
19 DayCard(day: day, isHighlighted: day == .current)
20 .frame(height: 200)
21 }
22 }
23 .padding(32)
24 }
25 }
26}
27
28#Preview {
29 DaysOfWeekView()
30}