0

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?

regetskcob
  • 1,172
  • 1
  • 13
  • 35
  • 1
    Are you sure you really mean VoiceOver (i.e. the accessibility feature of iOS allowing blind and visually-impaired people to use the devices through special gestures and speech *synthesis*, not recognition), or are you referring to dictation (in which case please adjust the title and text of your question)? – Boris Dušek Nov 17 '15 at 12:18
  • @BorisDušek you're right, sorry. – regetskcob Nov 17 '15 at 12:38

0 Answers0