AcknowList
AcknowList copied to clipboard
Change Navigation Title in SwiftUI
In SwiftUI
there is no straightforward way to customize the title for the Acknowledgment List view.
It would be nice to have an option to pass in the navigation title.
For now, one hacky way is to provide a .toolbar
along with the AcknowListSwiftUIView
at the time of setting it up as a destination of a NavigationLink
.
Here is a sample:
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
NavigationLink("Show Acknowledgements") {
AcknowListSwiftUIView(acknowledgements: [])
.toolbar {
ToolbarItem(placement: .principal) {
Text("3rd Party Libraries")
}
}
}
}
.navigationTitle("My App")
}
}
}
That’s a very good observation. Anyone got a suggestion on how to address it?