Apple Watch 8 Bug: SwiftUI Navigation Stack pops back with TabView

Alex Protyagov
2 min readMay 19, 2022

In our AppleWatch apps, such as Body Mass or Vitamins, we use TabView to let user swipe horizontally between 2 views. Dots on the bottom of the screen indicate those 2 tabs.

Everything worked awesome until Apple released WatchOS8. That is the time when things went all way south. On WatchOS8, when you tap on any navigation element inside TabView, such as the row in the pic above, you expect to go to the details screen. However, you only see the details view for a moment and pops it back.

https://youtu.be/vRop64by7e4

Apparently, the same issue affected iOS 15, there are many articles how to work around that issue on iPhone/iPad. All those approaches did not work for AppleWatch, mostly because SwiftUI on AppleWatch is limited, and bunch of nice tooling available on iOS is just not there.
So, here is how we fixed that for just release Body Size app and hope to apply the same fix to other apps as time permits.

First, the issue is only applicable to WatchOS8. Note, app is wrapped on hight level inside NavigationView, about 2 views above this one. Therefore, we decided to build body like this:

The WatchOS7 would follow the same logic as always using TabsView, we know it works great and looks nice and small:

However, the above would not work for WatchOS8. After trying a bunch of things we end up building our own “tab view” that is just a HStack inside GeomertyReader and DragGesture to recognize swipes, overall code got a bit larger:

Summary

There were some articles claiming that the latest releases of iOS15 addressed this issue, however, looks like WatchOS8 is not the highest priority on the Apple list of things to fix. I hope they fix this bug so that we all can use standard controls and stop inventing workarounds for Apple bugs.

--

--

Alex Protyagov

Tech enthusiast with 15 years of experience creating solutions for small startups, large scale retail, media, and government entities.