I do not understand what you are trying to do with your stillSpeaking. Generally, looping like while goingon ... does not make sense in GUI code.
When you want to detect the AVSpeechSynthesizer finished reading, you implement speechSynthesizer(_:didFinish:) of AVSpeechSynthesizerDelegate.
Please show all the relevant code, if you cannot make it by yourself.
Topic:
Programming Languages
SubTopic:
Swift
Tags: