Thank you for this great package! I have one very specific issue, which I am not sure if it is a problem with Factory, Supabase, or with my implementation. This is the scenario:
Package Dependencies:
Factory 2.4.0
Supabase 2.20.1
Swift version: 6.0
Navigation:
Main Page -> Navigate to Child View -> Navigate to Child Child View.
Issue:
When using a @Environment(\.dismiss) var dismiss in "Child View", the navigation from "Child View" to "Child Child View" crashes the app completely.
Here is a very basic example, with which you can replicate the issue:
import SwiftUI
import Factory
@main
struct BlankFactoryDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
var body: some View {
NavigationStack {
List {
NavigationLink {
ChildView()
} label: {
Text("Go to Child View")
}
}
.navigationTitle("Factory/Supabase Demo")
}
}
}
struct ChildView: View {
private let demoService = Container.shared.demoService()
@Environment(\.dismiss) var dismiss
var body: some View {
List {
NavigationLink {
ChildChildView()
} label: {
Text("Go to Child Child View")
}
}
.navigationTitle("Child View")
}
}
struct ChildChildView: View {
private let demoService = Container.shared.demoService()
var body: some View {
List {
Text("Child Child View")
}
.navigationTitle("Child Child View")
}
}
class DemoService {
func doSomething() {
print("Hello from DemoService")
}
}
extension Container {
var demoService: Factory<DemoService> {
self { DemoService() }
}
}
The app does not crash if either one of the following is done:
Do not add Supbase as a dependency
Do not add @Environment(\.dismiss) var dismiss in ChildView
Do not addprivate let demoService = Container.shared.demoService() in ChildChildView
Would be great if someone could check this. Let me know if more details are required to replicate the problem.
Hi,
Thank you for this great package! I have one very specific issue, which I am not sure if it is a problem with Factory, Supabase, or with my implementation. This is the scenario:
Package Dependencies:
Swift version: 6.0
Navigation: Main Page -> Navigate to Child View -> Navigate to Child Child View.
Issue: When using a
@Environment(\.dismiss) var dismiss
in "Child View", the navigation from "Child View" to "Child Child View" crashes the app completely.Here is a very basic example, with which you can replicate the issue:
The app does not crash if either one of the following is done:
@Environment(\.dismiss) var dismiss
in ChildViewprivate let demoService = Container.shared.demoService()
in ChildChildViewWould be great if someone could check this. Let me know if more details are required to replicate the problem.
Cheers, Sascha