I\'ve recently started working in SwiftUI, came to the conclusion that working with navigation isn\'t really great yet. What I\'m trying to achieve is the following. I final
I have found a straightforward approach to remove the back button text using SwiftUI only, and keeping the original chevron.
import SwiftUI
struct ContentView: View {
@Environment(\.presentationMode) var presentation
var body: some View {
VStack {
// Your main view code here
}
.navigationBarBackButtonHidden(true)
.navigationBarItems(leading: Button(action: { presentation.wrappedValue.dismiss() }) {
Image(systemName: "chevron.left")
.foregroundColor(.blue)
.imageScale(.large)
})
}
}