apple-watchswiftuiwatchoswatchos-6

In watchOS, is it possible to display a view without a status bar button that leads to the root view?


I would like to have a similar navigation structure to the built-in Workout app in watchOS. I have a list of tennis rules formats, analogous to workout types in the Workout app. Tapping one starts a match in a new interface controller. In WatchKit, as far as I know, I can only push an interface controller or present one. Both approaches risk the user canceling the match earlier from the top left chevron or tapping the status bar in a presented modally.

The workout does not have that limitation during a workout session, instead, the user ends the workout from switching pages in its page-based navigation. Does SwiftUI with its fully programmatic way of watchOS app development allow for accomplishing this?

Below is the initial view of the Workout app

enter image description here

Selecting a workout switches to a screen where the top left title isn't tappable, which is what I'd like to accomplish (the initial view is completely hidden and does not show when you swipe between the three pages)

enter image description here


Solution

  • Maybe you need to modify your view with:

        .navigationBarBackButtonHidden(true)
    

    Did you try that?