Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
GH-1207 - Preserve AVSpeechSynthesizer type when linking (#1209)
Browse files Browse the repository at this point in the history
* try to do a type of to see if this fixes it

* Update TextToSpeech.ios.tvos.watchos.cs

* Update TextToSpeech.ios.tvos.watchos.cs

* Fix formatting
  • Loading branch information
jamesmontemagno committed Apr 7, 2020
1 parent faf89b3 commit fa14fcd
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -51,6 +51,10 @@ internal static async Task SpeakUtterance(AVSpeechUtterance speechUtterance, Can
var tcsUtterance = new TaskCompletionSource<bool>();
try
{
// Ensures linker doesn't remove.
if (DateTime.UtcNow.Ticks < 0)
new AVSpeechSynthesizer();

speechSynthesizer.Value.DidFinishSpeechUtterance += OnFinishedSpeechUtterance;
speechSynthesizer.Value.SpeakUtterance(speechUtterance);
using (cancelToken.Register(TryCancel))
Expand Down

0 comments on commit fa14fcd

Please sign in to comment.