title: UIButtons are not responding during animation - iOS Swift 3
body: <p>I'm building a calculator app, when I tap on the buttons there is a short animation. The problem is the buttons do not respond while they are animating, which makes the app feel laggy.</p>
  
  <p>I found some solutions for Objective-C using:</p>
  
  <pre><code>UIViewAnimationOptionAllowUserInteraction
  </code></pre>
  
  <p>but nothing for Swift 3, my code looks like this:</p>
  
  <pre><code>func myButton () {
  
      sender.layer.backgroundColor = firstColor
      sender.setTitleColor(UIColor.white, for: UIControlState.normal)
  
      UIView.animate(withDuration: 0.5) {
          sender.layer.backgroundColor = secondColor
      }
  }
  </code></pre>