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)
}