OS: 10.15.2
Xcode: 11.3 (11C29)
Lesson: Building Lists & Navigation
Section 6 - List & Detail
My code:
import SwiftUI
struct LandmarkList: View {
var body: some View {
NavigationView {
List(landmarkData) { landmark in
NavigationLink(destination: LandmarkDetail()){
LandmarkRow(landmark: landmark)
}
.navigationBarTitle(Text("Landmarks"))
}
}
struct LandmarkList_Previews: PreviewProvider {
static var previews: some View {
LandmarkList()
}
}
}
}
var body line returns error: 'Function declares an opaque return type, but has no return statements in its body from which to infer an underlying type"
Next line - NavigationView { gives a yellow warning claiming the Result of 'NavigationView<Content>' initializer is unused
I think I have copied this perfectly from the lesson. Did the new XCode change something? If I've missed something please help me spot it - and if there is any additional explanation, I need to learn!
Thanks!!