NavigationLink work on simulator but don't work on real device iPhone

50 views Asked by At

I am new in SwiftUi and i try to run the code below.On simulator work well, but when try to run on real device (iPhone/iPad) work one time. The first time i can go to second view, but when i return with "

import SwiftUI

struct ContentView: View {
   var body: some View {
        NavigationView{
            NavigationLink(destination: Text("Second view")) { Text("First view")}
        }
    }
}

#if DEBUG
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
#endif
0

There are 0 answers