I think I have fixed this, without making any changes to the UINavigationController but to the view body itself.
NavigationView { // wrapping in NavigationView
SearchBarNavigationView(text: $searchText) {
Text(searchText)
} content: {
Text("Hello, World!")
.navigationTitle("Title")
}
.navigationTitle("Title") // for back button title
.navigationBarHidden(true) // hiding bar when showing main content
.ignoresSafeArea()
Text("No selection")
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: