UITextField begin dictation

霸气de小男生 提交于 2019-12-18 05:41:54

问题


I'd like to programmatically put my UITextField input into dictation mode, without requiring the user to bring up and select dictation from the keyboard. Searched the API documentation but can find no solution. Any ideas?


回答1:


This is currently not possible on iOS.

The only place where it is kind of possible is in an app using WatchKit. In WKInterfaceController you can actually use presentTextInputControllerWithSuggestions with nil as parameter which starts dictation input immediately.




回答2:


You have to implement SFSpeechRecognizer, use Accelerate framework to get mic sound level floats and make an animated view yourself. It will look cooler!

Sorry for not providing the code, I think i lost it. Can’t find it on my multiple hard drives :/




回答3:


Yes

With iOS 10 Apple added SFSpeechRecognizer which allows for starting speech recognition without user interaction.



来源:https://stackoverflow.com/questions/17503398/uitextfield-begin-dictation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!