Skip to content

Instantly share code, notes, and snippets.

@myrickchow32
Last active February 21, 2019 15:42
Show Gist options
  • Save myrickchow32/289399cdfccadb9a683dada783fce77f to your computer and use it in GitHub Desktop.
Save myrickchow32/289399cdfccadb9a683dada783fce77f to your computer and use it in GitHub Desktop.
import UIKit
import AVFoundation
class AVFoundataionDemoViewController: BaseViewController {
var avSpeechSynthesizer: AVSpeechSynthesizer!
override func viewDidLoad() {
super.viewDidLoad()
avSpeechSynthesizer = AVSpeechSynthesizer()
avSpeechSynthesizer.speak(AVSpeechUtterance(string: "Hello world"))
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print("viewDidDisappear")
}
deinit {
print("AVFoundationDemoViewController is deinit.")
}
}
extension AVFoundataionDemoViewController: AVSpeechSynthesizerDelegate {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment