UISearchBar and dictation support

ios, uisearchbar, uitextinput

Solution

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.

Problem

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?

Original source