@objc func buttoncheckMusic(_ sender : UIButton)
let tipsLabel = self.view.viewWithTag(1001) as! UILabel
var tag = sender.tag
if tag >= 5000 {
tag -= 5000
else if tag >= 4000 {
tag -= 4000
}
let row = Int (tag /cols)
let col = tag - cols * row
letresult = errorCords.filter{
$0==(row,col)
}
if result.count >-1(
let path = Bundle,main.path(forResource:"birdsound",ofType:"m4a")
let url = URL(fileURLWithPath:path!)
soundPlayer=try? AVAudioPlayer(contentsOf:url)
soundPlayer.play()
tipsLabel.text="不同找到:(\(row),\(co1))”
}
else {
let path= Bundle.main.path(forResource: "error",ofType:"m4a")
let url = URL(fileURLWithPath:path!)
soundPlayer=try? AVAudioPlayer(contentsof: url)
soundPlayer.play()
tipsLabel.text= "找错啦(\(row),\(co1))"
}
}