title: Xcode Swift Ios App: Adding delay
body: <p>I am working on a simple quiz game and i want to add some little delays to the game,now when i select the answer the game goes instantly to the next answer now i want to change the color of the button for 0.1 seconds and then loads the next question</p>
  
  <p>I tried the sleep function but it adds only the delay without the color change and i can't choose time intervals smaller than a second because it accepts integers as value</p>
  
  <p>here is the code</p>
  
  <pre><code>sender.backgroundColor = UIColor.greenColor()
  sleep(1)
  sender.backgroundColor = UIColor.whiteColor()
  </code></pre>
  
  <p>what i have to put instead of sleep to obtain what i want?</p>
  
  <p>thanks</p>