why my destination view navigationBarTitle and NavigationBarItems(trailing) show on the root navigationBar when i do left-edge swipe in swiftui , I swipe the screen to the right, and see the root view, but my destination view items are now showing on my root navigationBar ?
if I do it fast, it goes to the root view without any problem, when I do it slow the problem occurs, oh and everything pass, the default back button, the title, and the trailing item when is there.
Thanks
if I do it fast, it goes to the root view without any problem, when I do it slow the problem occurs, oh and everything pass, the default back button, the title, and the trailing item when is there.
Thanks
Code Block language import SwiftUI struct ContentView: View { var body: some View { NavigationView { NavigationLink(destination: SecondCounter()){ Text("Show Second Counter View")} .navigationBarTitle("RootView") } } struct SecondCounter : View { @State var timer: Timer? = nil @State private var secCounter = 0 var body: some View { Text("") .navigationBarTitle("Second Counter View" ,displayMode:.inline) .navigationBarItems(trailing:Text("\(secCounter)")) .onAppear { self.secondCounter() } .onDisappear { self.timer?.invalidate() self.timer = nil } } func secondCounter () { timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { _ in self.secCounter += 1 }) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } }
this is the whole program where I get the errors