Skip to content

Instantly share code, notes, and snippets.

@Spacerat
Last active June 24, 2024 03:18
Show Gist options
  • Select an option

  • Save Spacerat/6bffd11b968e570a1d549d4cfa669a83 to your computer and use it in GitHub Desktop.

Select an option

Save Spacerat/6bffd11b968e570a1d549d4cfa669a83 to your computer and use it in GitHub Desktop.
//
// 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