How to determine that a user has used voice input in iOS?

I would like to know when a user uses an iOS keyboard microphone to add text to a UITextField. So, after the keyboard is suitable for text input, as soon as they use the dictation microphone even once, a flag will be set to indicate that they used speech input. I need to do this for analytical use.

I tried to capture dictationRecordingDidEnd according to this:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInput_Protocol/Reference/Reference.html

And ran into the same problem as the author: dictationRecordingDidEnd never called

That method is never executed. Is there any other way to define speech?

+4
source share
1 answer

MyThis is an accepted protocol, so you need to override the method. This worked for me under iOS 8.1.1:

 #import <UIKit/UIKit.h> @interface MyTextField : UITextField @end #import "MyTextField.h" @implementation MyTextField - (void) dictationRecordingDidEnd { printf("dictationRecordingDidEnd\n"); } @end 
+1
source

All Articles