Created
December 4, 2021 01:11
-
-
Save leeyspaul/e6d7364f78e8998ffc4f207edb394810 to your computer and use it in GitHub Desktop.
Calendar SwiftUI implementation using LazyVGrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Calendar: View { | |
var cols: [GridItem] = [ | |
GridItem(spacing: 35), | |
GridItem(spacing: 35), | |
GridItem(spacing: 35), | |
GridItem(spacing: 35), | |
GridItem(spacing: 35), | |
GridItem(spacing: 35), | |
GridItem(spacing: 35) | |
] | |
var body: some View { | |
VStack { | |
Text("December") | |
.font(.system(size: 30, weight: .bold)) | |
LazyVGrid(columns: cols, spacing: 20) { | |
ForEach((1...31), id: \.self) { dayNum in | |
Text("\(dayNum)") | |
} | |
} | |
.frame(width: .infinity, height: 300) | |
.padding() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment