ios - WatchKit选项只能听写吗?

标签 ios watchkit dictation

我用:

 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,则命令按钮不存在,但是如果不处理数组,则将再次出现命令按钮。有什么办法只能通过听写来输入文本吗?

更新:
Apple确实有说明您是否直接将用户发送给听写的文档,不要提供任何答复并直接将他们发送到那里。我收集到的信息正确吗,当initialPhrases为nil时,我什么都没看到是因为模拟器的限制?

最佳答案

你是对的。论坛中的Dev传播者指出,由于缺乏支持,该模拟器不会显示任何命令。

确保您使用的是WKTextInputModePlain,并且suggestions数组为nil,并且一切都会好起来。

关于ios - WatchKit选项只能听写吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29159358/

相关文章:

iOS/WatchKit : Is there a way for the watch kit app(swift) to use the iOS code (Objective C)?

ios - 在 iOS 模拟器问题中运行 Apple Watch

push-notification - 如何从不同的通知启动Apple Watch应用程序的不同屏幕?

ios - 如何在 presentTextInputControllerWithSuggestions 中自定义听写 View

c# - 预定义文本的 .NET 语音识别

ios - 在 UITableView swift 中限制每个部分的单元格选择

ios - 对于基于 Cognito 用户池的登录,如何使用 iOS/Swift 中的 startPasswordAuthentication 委托(delegate)切换到登录屏幕?

objective-c - 将委托(delegate)设置为父 View Controller

iphone - 按钮不工作 iOS

python - 在没有麦克风小部件的情况下使用 OSX 语音识别