AVAudioPlayer not playing audio in Swift

后端 未结 10 1445
抹茶落季
抹茶落季 2020-12-16 03:10

I have this code in a very simple, single view Swift application in my ViewController:

var audioPlayer = AVAudioPlayer()

@IBAction func playMyF         


        
10条回答
  •  一生所求
    2020-12-16 03:30

    Important that AvPlayer is class member and not in the given function, else it goes out of scope... :)

提交回复
热议问题