title: Subclassing UIButton and overriding touch events - not working
body: <p>I need a scale spring animation for all my buttons in a project.
  So i subclassed UIButton and override touch event functions.</p>
  
  <pre><code>import UIKit
  
  class UIAnimatedButton: UIButton {
  
  override func touchesBegan(touches: Set&lt;NSObject&gt;, withEvent event: UIEvent) {
  
      UIView.animateWithDuration(0.1, animations: { () -&gt; Void in
          self.transform = CGAffineTransformMakeScale(0.8, 0.8)
  
      })
      super.touchesBegan(touches, withEvent: event)
  
  }
  
  override func touchesCancelled(touches: Set&lt;NSObject&gt;!, withEvent event: UIEvent!) {
  
  
      UIView.animateWithDuration(0.5,
          delay: 0,
          usingSpringWithDamping: 0.2,
          initialSpringVelocity: 6.0,
          options: UIViewAnimationOptions.AllowUserInteraction,
          animations: { () -&gt; Void in
              self.transform = CGAffineTransformIdentity
      }) { (Bool) -&gt; Void in
          super.touchesCancelled(touches, withEvent: event)
      }
  
  }
  
  
  override func touchesEnded(touches: Set&lt;NSObject&gt;, withEvent event: UIEvent) {
  
      UIView.animateWithDuration(0.5,
          delay: 0,
          usingSpringWithDamping: 0.2,
          initialSpringVelocity: 6.0,
          options: UIViewAnimationOptions.AllowUserInteraction,
          animations: { () -&gt; Void in
              self.transform = CGAffineTransformIdentity
          }) { (Bool) -&gt; Void in
              super.touchesEnded(touches, withEvent: event)
      }
    }
  } 
  </code></pre>
  
  <p>this works great in a fast tap but when i touch the button for a long time (1-2 seconds) i don't get a touch up inside action event.
  when i switch it back to a regular UIButton everything works fine.</p>
  
  <p>Any ideas why that happens?</p>