Here is the full function
print("GoodForm")
squatDetected = true
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
self.squatDetected = false
}
DispatchQueue.main.async {
self.showGoodFormAlert(with: confidence)
AudioServicesPlayAlertSound(SystemSoundID(1322))
}
}```
Post
Replies
Boosts
Views
Activity
if action == "GoodForm" && confidence > 0.80 && !squatDetected {
print("GoodForm")
squatDetected = true
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
self.squatDetected = false
}
DispatchQueue.main.async {
self.showGoodFormAlert(with: confidence)
AudioServicesPlayAlertSound(SystemSoundID(1322))
}
}