I have a set of UIButtons that plays different sounds when you click on them manually. I have another UIButton "Play" button that I want it to auto click the other buttons when I click on it.
Any help would be appreciated.
Update:
What i meant is I want to create a function that would play each buttons in different sequence. For instance, when I click on button, it plays buttons 1,2,3. Then when I click on playButton again, it plays buttons 2,5,6 etc
I believe having the sequence in an array might be easier than having it in a file.
@IBAction func notePressed(_ sender: UIButton) {
let soundURl = Bundle.main.url(forResource: "minisound\(sender.tag)", withExtension: "wav")
do {
audioPlayer = try AVAudioPlayer(contentsOf: soundURl!)
}
catch {
print(soundURl)
}
audioPlayer.play()
}
@IBAction func playButton(_ sender: Any) {
}