Solution:
https://developer.apple.com/forums/thread/670267?commentId=4300025&page=1#684115022
Post
Replies
Boosts
Views
Activity
If anyone comes across this in the future, I solved this problem with the following:
struct View1: View{
@State var KeepView2: Bool = false
var body: some View{
if self.KeepView2{
NavigationLink(destination: View2(keepViewOpen: self.$keepView2), isActive: self.$keepView2){
Text("Navigate")
}
}
}
}
struct View2: View{
@Binding keepViewOpen: Bool
var body: some View{
VStack{
Text("Hello World")
}.onAppear{
self.keepViewOpen = true
}
}
}
I'm stuck on this right now, did you find a solution?
I've made reproducible code that shows this issue; but after doing so, I realized that presentationMode isn't the problem. It's the way I've set up my own custom navigation due to the limitations of SwiftUI. I'll repost soon and hopefully there'll be a resolution.