When I add WatchOS as a target to my multi platform SwiftUI project, it creates its own ContentView within the Watchkit Extension folder. It does not seem to be able to access any views within the "Shared" folder in the multi platform App template, leaving me with two Content Views in the project.
Does anyone know how to add a WatchOS target and have it use the shared files? Can this be done?
I was encouraged because the App Essentials WWDC20 video implies WatchOS can be used with this template as they have a screenshot example, but so far haven't had success in duplicating it.
Create a Multiplatform project.
In the project tree, select the project root node. On the General tab, click the "+" to add a Target. Choose "Watch App." IMPORTANT: Name the product the same as the existing macOS and iOS product name.
In the WatchKit Extension files, delete the ContentView.swift. Choose "Move to Trash."
In the "Shared" folder, select the ContentView.swift file. In the first tab on the right pane in Xcode, in Target Membership, check the WatchKit Extension target to include it. At this point, you have an Independent Watch App that is not a companion of your iOS App.
In the folder for the WatchKit App, select the Info.plist. Add a new key named "WKCompanionAppBundleIdentifier" of Type "String" with Value equal to the Bundle Identifier of the iOS App in your project.
In the folder for the WatchKit Extension, select the Info.plist. Select the key named "App is only available as a standalone watchOS app" and change it to "App can run independently of companion iPhone app."
In the project tree, select the project root node. On the General tab, select the iOS target. In the "Frameworks, Libraries, and Embedded Content" section, click the "+" button to add an item. Add the WatchKit App.app item from your project.