Tag: 听写

知道什么时候听写已经在UITextView中结束

我想知道什么时候听写已经结束了(理想情况是什么时候开始)。 包含UITextView UIViewController符合UITextInputDelegate协议。 为了使它工作,我不得不订阅UITextInputCurrentInputModeDidChangeNotification override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: "changeInputMode:", name: UITextInputCurrentInputModeDidChangeNotification, object: nil) } 并在那里添加委托(它没有工作,只是将其添加到viewDidLoad()) func changeInputMode(sender : NSNotification) { textView.inputDelegate = self } 开始和停止听写UITextInput现在正确调用所需的委托方法: func selectionWillChange(textInput: UITextInput){ } func selectionDidChange(textInput: UITextInput){ } func textWillChange(textInput: UITextInput){ } func textDidChange(textInput: UITextInput){ } 但是没有被调用的是 func dictationRecordingDidEnd() { println("UITextInput Dictation ended") } 为什么? 我怎样才能得到通知/调用听写方法已经结束?

使用听写 – iOS 6 – DidStart?

如何回应开始听写? 已知的听写方式: dictationRecordingDidEnd – 响应已完成的口述短语的识别。 dictationRecognitionFailed – 回应失败的听写识别。 参考: UITextInput协议参考 从iOS 5.1开始,当用户在支持的设备上select听写input时,系统会自动将已识别的短语插入到当前的文本视图中。 UITextInput协议中的方法允许您的应用程序响应听写的完成,如“使用听写”中所述。您可以使用UIDictationPhrase类的对象来获取表示用户已经声明的短语的string。 在不明确的听写结果的情况下,听写短语对象提供包含替代string的数组。 http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInput_Protocol/Reference/Reference.html

UITextField开始听写

我想以编程方式把我的UITextFieldinput到听写模式,而不需要用户从键盘上popup和select听写。 searchAPI文档,但无法find解决scheme。 有任何想法吗?