You can have a Bool in your controller that says the button is valid or not, and when the button is pressed, install Bool and schedule a TimeInterval, for example:
Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(<YourMethod>), userInfo: nil, repeats: false)
Another strategy would be to press the button, turn off interaction with the property userInteractionEnabled, and then use the timer to turn the property back on.
source
share