I\'m writing a custom keyboard for iOS and I\'d like to detect when the user copies some text. I\'ve read that you can use the NSNotificationCenter along with
You cannot use NSNotificationCenter since the keyboard extension is a different process.
Cocoa includes two types of notification centers: The NSNotificationCenter class manages notifications within a single process. The NSDistributedNotificationCenter class manages notifications across multiple processes on a single computer.
Try this solution: https://stackoverflow.com/a/28436058/649379 which uses CFNotifications. Don't forget to enable App Groups to get access to the shared container.
More code here: https://github.com/cxa/AppExtensionCommunicator & https://github.com/mutualmobile/MMWormhole