0

I'm getting an module error in two of my controllers who tries to import the NotificationCenter framework. I have added the framework in "linked frameworks and libraries" but I'm still getting the error.

I even tried cmd + shift + k, but it did not do any good for me.

I also tried to set the framework search path to $(SRCROOT), but still same error.

I have two controllers with the import.

Linked frameworks and libraries

Added notificationCenter

TimeController

import WatchKit
import Foundation
import NotificationCenter   error: "No such module 'NotificationCenter'" 

SwipeController

import WatchKit
import Foundation
import NotificationCenter   error: "No such module 'NotificationCenter'" 

Any help would be much appreciated!

Hossein Golshani
  • 1,847
  • 5
  • 16
  • 27
Thosc
  • 7
  • 8

1 Answers1

0

I agree with @David's comment, There are three targets for a single watchOS project.

You need to try these steps for each Target: Select each target and go to -> Build Phases

Screen1

Click on the right arrow. and click on the + Step2

Finally, search for NotificationCenter and add the framework.

You need to try these steps for each target.

Watch

excitedmicrobe
  • 2,338
  • 1
  • 14
  • 30