I ty to recognize in my ViewController, wether the InputMode of my TextView is changed to Dictation.
This code worked until iOS 7.
// In viewDidLoad
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleCurrentInputModeDidChange:) name:UITextInputCurrentInputModeDidChangeNotification object:nil];
// a method of the controller
- (void)handleCurrentInputModeDidChange:(NSNotification *)notification
{
UITextInputMode *mode = [notification object];
NSString *primaryLanguage = [mode primaryLanguage];
if ([primaryLanguage isEqualToString:@"dictation"]) {
if ([[self delegate] respondsToSelector:@selector(notizControllerStartedVoiceRecognition:)]) {
[[self delegate] notizControllerStartedVoiceRecognition:self];
}
[self setWasVoiceInput:YES];
}
}
Now on iOS 8 and 9 we are getting "nil" for our mode variable in the code.
Can anybody explain me, how to get this working again?