Hi…
I have two views - ContentView() and BookReviewView()… Below is from my ContentView()… What is not working is when I click on the “book” under the label of the navigation view, it supposed to jump to BookReviewView() but it doesn’t… BookReviewView() only contains Text() at the moment… I also tried using Button() instead of NavigationLink() but same results…
Please advise… Am I missing anything? Don’t really want to peek on the solution… I want to finish the challenge by myself with a little help…
var body: some View {
GeometryReader { geo in
ScrollView {
LazyVStack (alignment: .leading) {
Text("My Library")
.font(Font.custom("Avenir Heavy", size: 24))
.padding(.bottom)
ForEach(bookModel.books) { book in
NavigationLink (
destination: BookReviewView(),
label: {
ZStack (alignment: .leading) { ... }
.padding()
}) // Navigation Link End
}
}
}
}
}
}
struct BookReviewView: View {
var body: some View {
VStack {
Text(“Amazing Words”)
.font(Font.custom(“Avenir Heavy”, size: 24))
.padding(.bottom)
Text(“Read Now!”)
.font(Font.custom(“Avenir Heavy”, size: 20))
.padding(.bottom)
Text("Mark for later!")
.font(Font.custom("Avenir Heavy", size: 14))
.padding(.bottom)
Text("Rate Amazing Words")
.font(Font.custom("Avenir Heavy", size: 15))
.padding(.bottom)
}
}
}