Strange Syntax / Mapping to Unchecked Sendable (from SpeechRecognizer example) #1298
-
continuation.onTermination = {
[
speechRecognizer = UncheckedSendable(speechRecognizer),
audioEngine = UncheckedSendable(audioEngine),
recognitionTask = UncheckedSendable(recognitionTask)
]
_ in
_ = speechRecognizer
audioEngine.wrappedValue?.stop()
audioEngine.wrappedValue?.inputNode.removeTap(onBus: 0)
recognitionTask.wrappedValue?.finish()
} A couple questions here as a Javascript developer:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is because
This example maybe goes above-and-beyond to prepare for Swift 6 (to the point of making the demo too complex, perhaps), but we use If you don't have concurrency warnings turned on, you can hold off on uses of |
Beta Was this translation helpful? Give feedback.
This is because
onTermination
takes aContinuation
as a parameter. We're not using it, though, so we ignore it with a_
.This example maybe goes above-and-beyond to prepare for Swift 6 (to the point of making the demo too complex, perhaps), but we use
UncheckedSendable
because Speech and other Appl…