Skip to content

Instantly share code, notes, and snippets.

@dllewellyn
Created January 9, 2021 09:47
Show Gist options
  • Select an option

  • Save dllewellyn/d336cc2076800e35fea7a4daec5d4046 to your computer and use it in GitHub Desktop.

Select an option

Save dllewellyn/d336cc2076800e35fea7a4daec5d4046 to your computer and use it in GitHub Desktop.
ListViewItem.swift
struct ListViewItem: View {
var title : String
var subtitle : String
var imageUrl : String
var body: some View {
VStack(alignment: .leading, spacing: nil) {
Text(title)
.font(.title)
Text(subtitle)
.font(.subheadline)
}.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .none, alignment: .topLeading)
}
}
struct ListViewItem_Previews: PreviewProvider {
static var previews: some View {
ListViewItem(title: "Test title", subtitle: "Test subtitle", imageUrl: "SampleImage")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment