Last active
June 24, 2024 03:18
-
-
Save Spacerat/6bffd11b968e570a1d549d4cfa669a83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ContentView.swift | |
| // NavigationTest | |
| // | |
| // Created by Joseph Atkins-Turkish on 6/23/24. | |
| // | |
| import SwiftUI | |
| import SwiftData | |
| struct Inner: View { | |
| @AppStorage("storage1") private var storage = false // Comment just this to fix the links | |
| var body: some View { | |
| Text("Page") | |
| } | |
| } | |
| struct SomeLink: View { | |
| @AppStorage("storage2") private var storage = false // Or comment just this to fix the links | |
| @Binding var foo: String | |
| var body: some View { | |
| NavigationLink { | |
| Inner() | |
| } label: { | |
| Text("Navigation link") | |
| } | |
| } | |
| } | |
| struct ContentView: View { | |
| @State private var value: String = "" | |
| var body: some View { | |
| NavigationStack { // Or make this a NavigationView to fix the links | |
| Form { | |
| SomeLink(foo: $value) | |
| SomeLink(foo: .constant("Value")) // Or comment just this to fix the links | |
| } | |
| } | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment