Vin
Vin

Reputation: 456

SFSpeechRecognitionTaskDelegate delegate methods are not getting called

I am working on speech to text iOS 10 feature.

I want SFSpeechRecognitionTaskDelegate's delegate methods to be called for checking the completed results.

func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult);

But its any delegate method is not getting called. Also I am curious about why its .delegate property which is not available for setting delegate to self.

Any Help will be appreciated. Thanks in advance.

Edited: Also, The delegate Property set by the protocol is not found in the documentaion. i.e.

@property (nonatomic, weak) id<SFSpeechRecognitionTaskDelegate> delegate;

is not available in SFSpeechRecognitionTask.h file. Is it necessary that we need property for that?

Upvotes: 4

Views: 2204

Answers (2)

masaldana2
masaldana2

Reputation: 654

use:

 self.speechRecognizer.recognitionTask(with:  self.recognitionRequest!, delegate: self)

Upvotes: 2

KAR
KAR

Reputation: 3361

refer this article, It contains demo app on speechkit in swift,

https://www.appcoda.com/siri-speech-framework/

It works fine for me.

Upvotes: 0

Related Questions