Closed IchordeDionysos closed 5 years ago
I start it like this:
@objc func startVoiceSearch() {
let overlay = VoiceOverlayController()
overlay.start(on: self, textHandler: { text, final in
print("voice output: \(String(describing: text))")
print("voice output: is it final? \(String(describing: final))")
if final {
self.searchControllerView.searchInput.text = text
}
}, errorHandler: { error in
print("voice output: error \(String(describing: error))")
})
}
Hi @IchordeDionysos ,
I actually realised what is the problem. You need to keep a reference to your overlay
variable in your ViewController, or else it won't be owned by anyone and you will lose reference to it. This should solve your problem. Just move the let overlay = VoiceOverlayController()
below your class declaration (as shown in the usage README)
Is this already usable?
Because I get a crash when the controller finishes. https://cl.ly/cf78707938f5/Screenshot%2525202018-10-12%252520at%25252016.19.37.png