Hello all,
Im trying to add a back.chevron to the attached section of code above the navigationBartitle without the previous title included within the back button.
any ideas ?
Thankyou
Connor
import SwiftUI struct ContentView: View { init() { // Customize the UINavigationBar appearance let appearance = UINavigationBarAppearance() appearance.titleTextAttributes = [.font : UIFont.systemFont(ofSize: 35)] // Increase title font size //appearance.largeTitleTextAttributes = [.font : UIFont.systemFont(ofSize: 35)] // Increase large title font size UINavigationBar.appearance().standardAppearance = appearance } @EnvironmentObject var appData: AppData
var body: some View {
NavigationStack(path: $appData.path) {
HStack {
Spacer() // Push the title to the center
VStack {
NavigationLink(value: 1) {
Circle()
.frame(width: 100, height: 100)
}
NavigationLink(value: 2) {
Circle()
.frame(width: 100, height: 100)
}
NavigationLink(value: 3) {
Circle()
.frame(width: 100, height: 100)
}
}
.navigationDestination(for: Int.self) { value in
if value == 1 {
TestView1()
}
else {
Text("Selected box: \(value)")
}
}
Spacer() // Push the content to the right
}
.navigationBarTitle("Todo Lists", displayMode: .inline)
//this section updates "path as you click though the navigation,links"
.onReceive(appData.$path) { CurrentSelectionCode in
let path = CurrentSelectionCode
print("your path is:", path)
}
}
}
}
struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }