ariefbayu
ariefbayu

Reputation: 21979

How To Use NSNotificationCenter In Sierra

I'm currently learning Swift for macOS and need to use NSNotificationCenter. In the documentation, it is said that I can use the class:

NSNotificationCenter documentation said that I can use it for macOS Sierra

However, Xcode doesn't seems to recognize the class:

Xcode doesn't recognize NSNotificationCenter

Is there some steps that's missing? Because, I get the impression that Foundation classes don't require import.

Upvotes: 0

Views: 251

Answers (1)

i6x86
i6x86

Reputation: 1627

In swift 3 it has changed to NotificationCenter.

Edit: this is an example on how you can use it I have no idea why it doesn't appear on your Xcode it can be a bug.

Upvotes: 3

Related Questions