The below contentview locks after clicking on any button. Each of the funcs are the same format as TextView at the bottom of the code. This makes no sense and I have been unable to find any relation to why it fails – commenting any of the three makes it work.
//
// ContentView.swift
// Chat Content View
//
// Created by Steven Barrett on 6/5/24.
//
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
NavigationLink(destination: SwiftUIView()) {
Text("SwiftUIView")
.fontWeight(.bold)
}
NavigationLink(destination: FocusView()) {
Text("FocusView")
.fontWeight(.bold)
}
NavigationLink(destination: TestView()) {
Text("TestView")
.fontWeight(.bold)
}
}
.padding()
}
}
}
#Preview {
ContentView()
}
struct TestView: View {
var body: some View {
Text("Test View")
}
}`
I have tried commenting out one of the three and then the remaining two buttons can be selected and work as expected.
The expectation is that the buttons should execute the indicated function.
steven barrett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.