问题描述
我一直在尝试构建一个 IOS 应用程序,它允许我单击一个按钮并播放音频,但我遇到了这个错误,只能声明 @IBAction 实例方法。我进行了搜索,但似乎我没有将其关闭课堂或类似的东西,但它仍然不想工作
import UIKit
import AVFoundation
class LevelAStartingSoundViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
@IBAction func Sbutton(_ sender: Any,forEvent event: UIEvent) {
playSound(sound: "Ssound",type: "wav")
}
}
}