Shinning River
Shinning River

Reputation: 813

NSNotificationCenter not working with Custom Keyboard

I am developing a custom keyboard using Swift. I want to get UIDeviceOrientationDidChangeNotification when Orientation changes; for that purpose, I am using:

NSNotificationCenter.defaultCenter().addObserver(self, selector: "changeOrientation:", name: UIDeviceOrientationDidChangeNotification, object: nil)

func changeOrientation(notification: NSNotification) {  }

It works with a simple app, but doesn't work with custom keyboard extension.

Upvotes: 0

Views: 519

Answers (2)

CoderDan
CoderDan

Reputation: 462

To anyone new to Extensions

Select your extension target, Select 'play' it will ask you to chose an app to run. Select an appropriate app.

Then you are running with the debugger attached to your extension and can use breakpoints.

-Dan

Upvotes: 1

Mx83
Mx83

Reputation: 51

What did you put in your changeOrientation function ? Breakpoints aren't working for me in the keyboard swift file.

Upvotes: 0

Related Questions