Skip to content

Instantly share code, notes, and snippets.

@mikru1688
Created November 20, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikru1688/8af6455b9b62e96de2fe25065b8708fe to your computer and use it in GitHub Desktop.
Save mikru1688/8af6455b9b62e96de2fe25065b8708fe to your computer and use it in GitHub Desktop.
struct ContentView: View {
var programmingBooks: [ProgrammingBook] = []
var body: some View {
NavigationView {
List(programmingBooks) { programmingBook in
NavigationLink(destination: DetailView(name: programmingBook.name, content: programmingBook.content, imageName: programmingBook.imageName)) {
Image(programmingBook.imageName)
.clipShape(Circle())
VStack(alignment: .leading) {
Text(programmingBook.name)
.font(.title)
Text(programmingBook.publisher)
.font(.subheadline)
.foregroundColor(Color.gray)
}
}
}
.navigationBarTitle(Text("ProgrammingBooks"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment