In my app, I am trying to run something, but only if the state of a button has stayed the same for 10 seconds. More specifically, I want to remove an element from an array if the button is checked for 10 seconds without interruption. How would I do this?
The following code is for showing which state the button should be in:
if tasksfinal[indexPath.row].checked {
cell.checkBoxOutlet.setBackgroundImage(UIImage(named: "checkBoxFILLED"), for: UIControl.State.normal)
//INSERT NEW CODE HERE
} else {
cell.checkBoxOutlet.setBackgroundImage(UIImage(named: “checkBoxOUTLINE”), for: UIControl.State.normal)
}