I am trying to implement a xylophone where I want to play different sounds on tap of different buttons which I merged it to one IBAction function and have differentiated with different tags.
@IBAction func keysPressed(_ sender: UIButton) {
}
I am importing AVFoundation but not getting the exact function to call to play sounds
I need a function which I can call in each If else statement differentiating buttons with tags to play sounds.