WatchKit选项只能指定? [英] WatchKit Option to ONLY Dictate?

查看:129
本文介绍了WatchKit选项只能指定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用:

 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.
                                             }
                                         }];

这是Apple提供的文本输入示例。但是,在我的应用程序中,我希望用户只能选择指定文本。如果我将数组设置为nil,那么dictate按钮就不存在,但是如果我单独留下数组,则会再次出现该指令按钮。是否有任何方法只能通过听写进行文本输入?

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?

更新:
Apple确实有文档说明如果您直接向用户发送指令,不提供任何回复并直接发送给他们。我是否正确地收集了在initialPhrases为零时我没有看到任何东西的原因仅仅是由于模拟器的限制?

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?

推荐答案

你是对的。论坛中的开发布道者已经注意到,由于缺乏支持,模拟器不会显示任何用于听写的内容。

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.

确保你使用 WKTextInputModePlain 建议数组是 nil ,你会没事的。

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

这篇关于WatchKit选项只能指定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆