The AVSpeechSynthesizer class helps you produces synthesized speech from text and allows you to control and monitor the progress of ongoing speech. In this video from Apple World Wide Developer Conference (WWDC) 2018 you will learn the ins and outs of AVSpeechSynthesizer and how to add computer-generated speech output to your app. While at the time the class was available on iOS only, in more recent years it has been ported to other Apple platforms as well.
Speech can enhance the audio experience of your app, whether you are generating spoken feedback for accessibility, or providing critical information beyond simple alerts or notifications.
Note: a transcript for the video is available from its official page.