SwiftUI Implementation

Do you have any recommendations for implementing the Spokestack pipeline in SwiftUI? I’m not sure how to use SpeechEventListener with the View struct. Using UIKit, I just extended ViewController to implement the SpeechEventListener delegate functions. (sorry for the elementary-level question – I’m just starting to learn Swift)

Thanks for any help you can provide!

Hi Nathaniel, thanks for using Spokestack!

Extending the ViewController to implement SpeechEventListener is a totally fine approach! For a (non-SwiftUI) reference, you can check out the frameworks built-in example project. Note that the most recent 14.0 release uses SpokestackDelegate instead of SpeechEventListener, but there’s no difference in implementation.

Since you’re already using SwiftUI, you may also be interested in checking out Spokestack Tray, our SwiftUI component framework. The code to add to your ViewController is quite straightforward.

Hope this helps!

1 Like