-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathSpeech.swift
60 lines (57 loc) · 2.02 KB
/
Speech.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#if canImport(Speech)
import Speech
@available(iOS 10, macOS 10.15, *)
extension SFSpeechRecognizerAuthorizationStatus: CustomDumpStringConvertible {
public var customDumpDescription: String {
switch self {
case .authorized:
return "SFSpeechRecognizerAuthorizationStatus.authorized"
case .denied:
return "SFSpeechRecognizerAuthorizationStatus.denied"
case .notDetermined:
return "SFSpeechRecognizerAuthorizationStatus.notDetermined"
case .restricted:
return "SFSpeechRecognizerAuthorizationStatus.restricted"
@unknown default:
return
"SFSpeechRecognizerAuthorizationStatus.(@unknown default, rawValue: \(self.rawValue))"
}
}
}
@available(iOS 10, macOS 10.15, *)
extension SFSpeechRecognitionTaskHint: CustomDumpStringConvertible {
public var customDumpDescription: String {
switch self {
case .confirmation:
return "SFSpeechRecognitionTaskHint.confirmation"
case .dictation:
return "SFSpeechRecognitionTaskHint.dictation"
case .search:
return "SFSpeechRecognitionTaskHint.search"
case .unspecified:
return "SFSpeechRecognitionTaskHint.unspecified"
@unknown default:
return "SFSpeechRecognitionTaskHint.(@unknown default, rawValue: \(self.rawValue))"
}
}
}
@available(iOS 10, macOS 10.15, *)
extension SFSpeechRecognitionTaskState: CustomDumpStringConvertible {
public var customDumpDescription: String {
switch self {
case .canceling:
return "SFSpeechRecognitionTaskState.canceling"
case .completed:
return "SFSpeechRecognitionTaskState.completed"
case .finishing:
return "SFSpeechRecognitionTaskState.finishing"
case .running:
return "SFSpeechRecognitionTaskState.running"
case .starting:
return "SFSpeechRecognitionTaskState.starting"
@unknown default:
return "SFSpeechRecognitionTaskState.(@unknown default, rawValue: \(self.rawValue))"
}
}
}
#endif