I have a relatively simple SwiftUI component that is a member of both my iOS App target as well as the corresponding WatchKit Extension.
As long as I select either the App scheme and select only the App target, or
the Watch scheme and select only the WatchKitExtension target
the preview works just fine.
As soon as I include the View in both targets, the preview fails with
The run destination iPhone 12 Pro Max is not valid for Running the scheme 'Trallala WatchKit App'. or
The run destination Apple Watch Series 6 - 44mm is not valid for Running the scheme 'MultiTimer'.
respectively. I get that the creation of the preview depends on the current target, but why does including it in additional targets create this error, and of course more important:
How to address that?
Additional question: Is there a way to create previews for both target platforms side by side?
Thanks a million
Klaus
6
0
4.7k