Text on BackButton of Navigation - SwiftUI

Viewed 168

How to change the text of button "back" of the navigationBar on swiftUI? form from a navigationLink

init(){
    UINavigationBar.appearance().backgroundColor = UIColor(named: "azul")
    UINavigationBar.appearance().tintColor = UIColor(named: "azul")
    UINavigationBar.appearance().barTintColor = UIColor(named: "azul")
    UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor.white]
    UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: UIColor.white]
    UITableView.appearance().separatorColor = .clear
}

var body: some View {
    NavigationView() {
        List {
            NavigationLink(destination: CalculoCPKDadosHoffView()) {
                FuncionalidadeRow(nome: "Cálculo de CPK - Ciclo total do pneu",
                                  descricao: "Calcula o custo por quilômetro rodado de um pneu e suas recapagens e compara com o concorrente.")
            }
            NavigationLink(destination: CalculoMMSulcoView()) {
                FuncionalidadeRow(nome: "Cálculo mm de sulco - Ciclo total do pneu", descricao: "Calcula o custo por milímetro de sulco de um pneu e compara com o concorrente.")
            }
            //NavigationLink(destination: TelaTeste()) {
            //    FuncionalidadeRow(nome: "Tela teste", descricao: "Apenas para fazer testes no app.")
            //}
        }.navigationBarTitle("Funcionalidades")
    }
1 Answers

The NavigationView should take the "Back" text to the text of the navigationBarTitle

Related