Skip to content

Instantly share code, notes, and snippets.

@karigrooms
Created February 23, 2021 18:39
Show Gist options
  • Save karigrooms/83e08753a885067fe4f7313fd154b52d to your computer and use it in GitHub Desktop.
Save karigrooms/83e08753a885067fe4f7313fd154b52d to your computer and use it in GitHub Desktop.
Blog post: SwiftUI with UICollectionView - 1. Simple card view to use inside of UICollectionViewCell
import SwiftUI
struct Card: View {
var body: some View {
VStack(alignment: .leading, spacing: 8) {
Image("condos")
.resizable()
.clipShape(RoundedRectangle(cornerRadius: 4))
Text("Condo with awesome views of downtown")
.font(.headline)
Text("$42 avg/night")
.font(.body)
.lineLimit(1)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment