Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchBar and dictation support

I have user interface with UISearchBar and I implement the UISearchBarDelegate's searchBarSearchButtonClicked: to perform the search. I do not have a device with dictation support to test this, so I'm going to speculate here...

On devices with dictation support, I would like to perform the search as soon as the dictation ends, without requiring the user to hit the search button manually.

  • Does this work out-of-the-box?
  • Or do I need to handle it programmatically?

Since iOS 5.1, there are new methods in UITextInput protocol and I could theoretically hook onto dictationRecordingDidEnd. Is that the way to go?

like image 349
Palimondo Avatar asked Jul 18 '12 09:07

Palimondo


1 Answers

Yes, you would want to use the dictationRecordingDidEnd protocol method. Apple's documentation says this about dictationRecordingingDidEnd:

Implement this optional method if you want to respond to the completion of the recognition of a dictated phrase.

That said, I have yet to find in Apple's human interface guidelines anything that talks about the expected use of this method.

You may also want to look at dictationRecongitionFailed as well as the UIDictationPhrase class.

like image 69
Barlow Tucker Avatar answered Oct 16 '22 19:10

Barlow Tucker