mattasaminew / watchos-navlink-swiftui-bug

Example Project to demonstrate bug in SwiftUI when NavigationLink is activated inside a TabView
0 stars 0 forks source link

Any fix yet? #1

Open uioporqwerty opened 2 years ago

uioporqwerty commented 2 years ago

Also receiving this issue on 8.4.1. Or did you find a workaround?

uioporqwerty commented 2 years ago

@mattasaminew

mattasaminew commented 2 years ago

@uioporqwerty Still appears to be unresolved. I created a workaround in the mean time, I will add it to this repo later today.

mattasaminew commented 2 years ago

@uioporqwerty Take a look at the PageView component in Workaround.swift. In my case I was using a ForEach component in the body of the TabView, but ForEach renders as s single component so I ended up passing an array of views to PageView. If you want to keep it a bit more syntactically SwiftUI, you can swap the pages property with a @ViewBuilder but you'll need to pass in pageCount explicitly if you're using a ForEach in the view builder

roz0n commented 2 years ago

Can confirm this is still unfixed in watchOS 8.5 (19T241)