Xcode Version 16.2/iOS 13 with view animation
@IBAction func keyPressed(_ sender: UIButton) {
playSound(soundName: sender.currentTitle!)
sender.alpha = 0.5
UIView.animate(withDuration: 0.2) {
sender.alpha = 1
}
}