2

I have a simple use case where a screen pushes another screen using the NavigationLink that is part of List element populated by a ForEach. The pushed screen is popped just after being pushed. This is working just fine on iOS 14.x, but not on iOS 15. Dose anyone know any workaround for this issue? Or any other solution how to fix this?

Here is a sample code:

List { ForEach(dataToPopulateListFrom, id: \.id) { data in NavigationLink(destination: SomeView() .environmentObject(someEnviorementObject) .navigationBarTitle("", displayMode: .inline)) { SomeOtherView() } } } 

1 Answer 1

2

I'm seeing something similar, except it's happening when trying to pop a second view onto the stack from the detail view accessed by a list.

It seems the parent view is being redrawn multiple times leading to multiple separate instances of the parent view existing. Can you try adding output to the 'onAppear' method to the view containing the list, and see if it's being called multiple times?

My experience trying to maintain a project in SwiftUI has been absolutely abysmal, something is completely broken on every minor iOS point release. To anyone considering starting a project using SwiftUI, I categorically do not recommend it.

Sign up to request clarification or add additional context in comments.

3 Comments

Yes, Last time as well when they release the Xcode update with iOS 14, They broke navigation links completely, and I did fix this after wasting a couple of hours.
I have the same issue, this bothers me
I have the same issue.... was only on iOS 14.5, but now I'm seeing it on 15... it's so frustrating. Anyone found anything, if not that empty navigationlink solution, that doesn't work for me all the time

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.