I'm having trouble wrapping my head around SwiftUI's declarative syntax. For instance, in the Landmarks code, when creating the List ...
var body: some View {
NavigationView {
List(landmarkData) { landmark in NavigationButton(destination:LandmarkDetail()) {
LandmarkRow(landmark: landmark)
}
}.navigationBarTitle(Text("Landmarks"))
}
}
... why is the navigationBarTitle associated with the List? I *think* it's analagous to UINavigationControllers, where each UITableViewController has a navigationItem (and a title). Is that right?
More confusingly (for me), why is the LandmarkRow inside the NavigationButton? I think of a button as part of a UITableViewCell, so here the analogy breaks down. Can someone explain this?