Der*_*ive 5 ios watchkit speechkit watchos-3
我尝试导入 watchOS 的 SpeechKit 框架并收到错误。有什么办法可以和手表一起使用吗?当我导入 Speechkit 框架时出现错误,提示“没有这样的模块语音”
import WatchKit
import Foundation
import Speech
class SpeechInterfaceController: WKInterfaceController, SFSpeechRecognizerDelegate {
override func awake(withContext context: Any?) {
super.awake(withContext: 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()
}
Run Code Online (Sandbox Code Playgroud)
}
语音框架不在 watchOS SDK 中(至少从 watchOS 3.0-3.1 开始)。您可以在框架文档中看到这一点:
(如果它支持 watchOS、tvOS 或 macOS,这些将列在该页面上的 SDK 下。)
您还可以在 Xcode SDK 中查看可用框架集:查看Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.1.sdk/System/Library/Frameworks/
,或者查看 watchOS 系统头文件的 ObjC 版本时查看 Xcode 编辑器窗格顶部的跳转栏,或者手动查看可用选项列表。添加到项目的 WatchKit 扩展目标的链接框架和库。
归档时间: |
|
查看次数: |
645 次 |
最近记录: |