ioswatchkitdictation

WatchKit Option to ONLY Dictate?


I use:

 NSArray* initialPhrases = @[@"Let's do lunch.", @"Can we meet tomorrow?", @"When are you free?"];
    [self presentTextInputControllerWithSuggestions:initialPhrases
                                   allowedInputMode:WKTextInputModePlain
                                         completion:^(NSArray *results) {
                                             if (results && results.count > 0) {
                                                 id aResult = [results objectAtIndex:0];
                                                 // Use the string or image.
                                             }
                                             else {
                                                 // Nothing was selected.
                                             }
                                         }];

This is the example given for text input by Apple. However, in my app, I want the user to ONLY have the option to dictate text. If I set the array to nil, the dictate button is not there, but if I leave the array alone, the dictate button reappears. Is there any way at all to do text input ONLY by dictation?

UPDATE: Apple does have documentation that says if you are sending users straight to dictation, to not provide any responses and send them straight there. Am I correct in gathering that the reason I don't see anything when initialPhrases is nil is just due to simulator restrictions?


Solution

  • You are correct. Dev evangelists in the forums have noted that the simulator won't show anything for dictation, owing to its lack of support.

    Make sure you're using WKTextInputModePlain and the suggestions array is nil and you'll be fine.