1
votes

I wan't to display a SwiftUI View as fullscreen in watchOS (without the Cancel/Back Button or Clock)

I've tried adding a Sprite Kit Scene to the view and also setting the .edgesIgnoringSafeArea(.all) but I'm still able to hide them or put a view under the top bar.

2

2 Answers

4
votes

Turns out it does "work", even with SwiftUI:

Using Interface Builder: https://developer.apple.com/documentation/watchkit/wkinterfaceskscene/configuring_a_watchkit_scene_in_a_storyboard

Using SwiftUI (watchOS 7):

@main
struct BitApp: App {
  @SceneBuilder var body: some Scene {
    WindowGroup {
      ContentView()
        .edgesIgnoringSafeArea(.all)
    }

    WKNotificationScene(controller: NotificationController.self, category: "myCategory")
  }
}

Remove any NavigationView and use edgesIgnoringSafeArea and it works!

Edit: It won't remove the clock though, as it will be positioned in the corner in front of the SpriteKit scene.

1
votes

Unless it's a game, it's not possible to strip out the space at the top, watchOS reserves it so that the time is always visible to the user.