相关疑难解决方法(0)

可以为 INIntent 属性赋予值“每次询问”吗?

假设我已经FooIntent.intentdefinition文件中定义了一个名为 的自定义意图。

它有一个bar类型Decimal为的单个参数,其中:
-User can supply value in Siri and Shortcuts app是活动的。
-Default Value0

其自动生成的类定义现在如下所示:

public class FooIntent: INIntent {
    @NSManaged public var bar: NSNumber?
}
Run Code Online (Sandbox Code Playgroud)

如果我构造 a FooIntent,设置barnil,并将其传递给 a INUIAddVoiceShortcutViewController

let intent = FooIntent()
intent.bar = nil
intent.suggestedInvocationPhrase = "Do foo"

let shortcut = INShortcut(intent: intent)

let viewController = INUIAddVoiceShortcutViewController(shortcut: shortcut!)
viewController.delegate = self
window?.rootViewController?.present(viewController, animated: true, completion: nil) …
Run Code Online (Sandbox Code Playgroud)

ios swift sirishortcuts

5
推荐指数
1
解决办法
499
查看次数

标签 统计

ios ×1

sirishortcuts ×1

swift ×1