0

I have this code that allows users to enter a code into the Apple Watch and once the user data is collected, it should navigate the user to a different page. The struggle is that the NavigationLink does not always work.

I get this error message "NavigationLink presenting a value must appear inside a NavigationContent-based NavigationView. Link will be disabled."

The iOS deployment is set to 11 and deployment target is set to 8.0.

VStack{
    TextField("Watch ID", text: $idValue)

    Button("Connect") {
        isLoading = true
        getID()
    }.background(Color(UIColor(red: 0.09, green: 0.20, blue: 0.38, alpha: 1.00))).cornerRadius(15).padding(.top,10).disabled(isLoading)
    if self.isLoading {
        ProgressView()
            .zIndex(1)
    }
    else
    {
        ProgressView().hidden()
    }
    NavigationLink(
        destination: ContentView(),
        isActive:$navigateToFirstScreen,
        label: {
        }).hidden().frame(height:0)
    Text(errorValue)
}
HangarRash
  • 7,314
  • 5
  • 5
  • 32
SamIAm
  • 51
  • 3
  • 2
    Where is the `NavigationView` or the `NavigationStack`? Did you read the [documentation](https://developer.apple.com/documentation/swiftui/navigationstack)? – HunterLion May 05 '23 at 22:22
  • Thanks - this used to work a while back without the NavigationView. I added that and that resolved it! – SamIAm May 07 '23 at 01:42

0 Answers0