Hey. I'm new to coding. I'm trying to make this simple soundboard, but I keep getting this mistake. I don't know why.
import UIKit
import AVFoundation
class ViewController: UIViewController {
let soundFilenames = ["sound1", "sound2", "sound3", "sound4", "sound5"]
var audioPlayers = [AVAudioPlayer]()
override func viewDidLoad() {
super.viewDidLoad()
/
/
for sound in soundFilenames
do { ---> HERE, I KEEP GETTING A " EXPECTED '{' TO START THE BODY OF FOR-EACH LOOP "
let audioPath = Bundle.main.path(forResource: sound, ofType: "wav"),
try audioPlayers = AVAudioPlayer(contentsOf: NSURL(fileURLWithPath: audioPath!))
}
catch
{
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
}