card view:
- upper part is the image
- lower part is the text description
start with the image
struct CardView: View {
var body: some View {
Image("swiftui-button")
.resizable()
.aspectRatio(contentMode: .fit)
}
}
implement the text description
VStack (alignment: .leading) {
Text("SwiftUI")
.font(.headline)
.foregroundColor(.secondary)
Text("Drawing a Border with Rounded Corners")
.font(.title)
.fontWeight(.black)
.foregroundColor(.primary)
.lineLimit(3)
Text("Written by Vinh Phan".uppecased())
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()