I am working on a simple quiz game and I want to add some slight delays to the game, now when I select an answer, the game immediately goes to the next answer, now I want to change the button color by 0.1 seconds and then load the next question
I tried the sleep function, but only adds a delay without changing the color, and I cannot select time intervals of less than a second, because it takes integers as a value
here is the code
sender.backgroundColor = UIColor.greenColor() sleep(1) sender.backgroundColor = UIColor.whiteColor()
What should I put instead of sleep to get what I want?
thanks
source share