I have a Form
view that sets the navigation bar title to "Settings" and a Picker
view inside the Form
view that sets the navigation bar title to "Options".
When navigating to Picker
view, the navigation bar title does not get set to "Options", but the back button text does. Also, when navigating back to Form
view, the navigation bar title is changed to "Options".
How can I have the navigation bar title be "Settings" while on Form
view and "Options" while on Picker
view? Thanks!
var body: some View {
NavigationView {
Form {
Picker(selection: $currentSelection, label: Text("Options")) {
ForEach(0 ..< options.count) {
Text(options[$0])
}
}
.navigationBarTitle("Options", displayMode: .inline)
}
.navigationBarTitle("Settings", displayMode: .inline)
}
}