Search code examples
iosswiftwatchkitwatchos-2

Class available to iOS and WatchOS apps?


Is there a way to create a class that is available to both iOS and WatchOS apps?

I'd like to create a mock data source from a single static class. I don't want to the class to live inside the iOS app or the Watchkit Extension. But I'd still like it to be inside the overall project.

If that isn't possible, I guess having the class live inside the iOS app is best? From there, I can transfer its data to the WatchOS app.


Solution

  • Tick the watch extension option under "target membership" of "file inspector" to include that file under the extension :)