Skip to content

Instantly share code, notes, and snippets.

@standinga
Created May 2, 2019 19:10
Show Gist options
  • Save standinga/3363834a35e27e949f171e001dcb34d3 to your computer and use it in GitHub Desktop.
Save standinga/3363834a35e27e949f171e001dcb34d3 to your computer and use it in GitHub Desktop.
ViewController for medium article (1st version)
import Cocoa
class ViewController: NSViewController {
private var audioPlayer: AudioPlayer!
override func viewDidLoad() {
super.viewDidLoad()
guard let url = Bundle.main.url(forResource: "z", withExtension: "wav") else {
fatalError("can't create url from resource")
}
audioPlayer = AudioPlayer(url)
audioPlayer.play()
}
override var representedObject: Any? {
didSet {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment