Watch OS voice input, watchos
WatchKit provides a standard modal interface for retrieving text input from users. When displayed, the interface allows you to enter text or standard group phrases or emojis by dictation,
Import WatchKitimport Foundationclass ComplaintInterfaceController: WKInterfaceController {@ IBOutlet var inputText: WKInterfaceLabel! Override func awakeWithContext (context: AnyObject ?) {Super. awakeWithContext (context) // Configure interface objects here .} override func willActivate () {// This method is called when watch view controller is about to be visible to user super. willActivate ()} override func didDeactivate () {// This method is called when watch view controller is no longer visible super. didDeactivate ()} // voice input @ IBAction func inputAction () {let initialPhrases = [" Spam applications. "," Are there any other spam applications? "," Is this free? "]; Self. presentTextInputControllerWithSuggestions (initialPhrases, allowedInputMode: WKTextInputMode. Plain) {(results)-> Void in if results! = Nil & results !. Count> 0 {let aResult = results! [0] print (aResult) self. inputText. setText (aResult? String)} else {print ("error") }}@ IBAction func suggestPlaint () {print ("already submitted ")}}