title: How do you set the delegate for an SFSpeechRecognitionTask?
body: <p>In most cases, setting a delegate is as simple as implementing the delegate protocol in a class and declaring an instance of that class as the delegate for an instance of whatever you're using.</p>
  
  <p>I actually used this same basic concept for the SFSpeechRecognizer which belongs to the same speech framework in my code. (Pseudocode example):</p>
  
  <pre><code>class myViewControllerClass: SFSpeechRecognizerDelegate{
  
  let mySpeechRecognizer = SFSpeechRecognizer(...)
  
  viewDidLoad(){
  mySpeechRecognizer.delegate = self
  }
  ...
  
  //SFSpeechRecognizerDelegate Functions here
  ...
  
  }  
  //This works as expected, woo!
  </code></pre>
  
  <p>However, it seems that SFSpeechRecognitionTask has no delegate property which can be set. I tried implementing the 'SFSpeechRecognitionTaskDelegate' protocol in my class in hopes that it would just magically work. However the delegate functions don't seem to ever be called. Which kind of makes sense, because it has no way of knowing that my view controller should be the delegate so why would it!?</p>
  
  <p>The apple documentation covers the protocol itself and how to use it:</p>
  
  <p><a href="https://developer.apple.com/reference/speech/sfspeechrecognitiontaskdelegate" rel="nofollow noreferrer">https://developer.apple.com/reference/speech/sfspeechrecognitiontaskdelegate</a></p>
  
  <p>But the documentation for the task itself doesn't identify any delegate property:</p>
  
  <p><a href="https://developer.apple.com/reference/speech/sfspeechrecognitiontask" rel="nofollow noreferrer">https://developer.apple.com/reference/speech/sfspeechrecognitiontask</a></p>
  
  <p>Also for reference here's the SFSpeechRecognizer documentation which has the protocol AND identifies a delegate property as you'd expect:</p>
  
  <p><a href="https://developer.apple.com/reference/speech/sfspeechrecognizer" rel="nofollow noreferrer">https://developer.apple.com/reference/speech/sfspeechrecognizer</a></p>
  
  <p>Is there some alternative way I'm supposed to be setting the delegate for an SFSpeechRecognitionTask? Or is it handled in some completely different way?</p>