0

If I create a brand new xCode project with a WatchKit extension this is what I get created by default in the main app file:

struct WorkoutApp: App {
    @available(watchOSApplicationExtension 7.0, *)
    var body: some Scene {
        WindowGroup {
            NavigationView {
                ContentView()
            }
        }

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

However, many types such as Scene, WindowGroup and the @Main modifier are not available in WatchOS 6. I didn't find any example on how to create a watch kit extension with WatchOS 6 in SwiftUI. I either find examples that use the old way (with storyboards, without SwiftUI), or examples that use this construct or examples with storyboards.

How do I rearrange the project to compile and run for WatchOS 6?

Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187

0 Answers0