0

I want to use NotificationCenter inside a watchOS target. But I get the following error message when building the app at import NotificationCenter:

NotificationCenter is not available when building for watchOS Simulator.
Consider using `#if !os(watchOS)` to conditionally import this framework.

How do you handle this situation? Can I no longer use the simulator?

maroony
  • 1
  • 4

1 Answers1

0

Ok, I mixed things up. All I want to do in my watchOs framework was something like this:

NotificationCenter.default.post(...)

The class with import NotificationCenter was in the wrong framework. No need for such a class in a watchOs framework. So my problem is fixed.

maroony
  • 1
  • 4