             return
         }
         
-        func onTap(sender: AnyObject?) {
-            
-            self.userInteractionEnabled = false
-            
-            let duration: Double = 0.3
-            
-            UIView.animateWithDuration(duration/2, animations: {
-                self.transform = CGAffineTransformMakeScale(0.95, 0.95)
-                
-            }) { complete in
-                
-                self.onTapCallback?(animatedButton: self)
-                
-                UIView.animateWithDuration(duration/2, animations: {
-                    self.transform = CGAffineTransformIdentity
-                }) { complete in
-                    self.userInteractionEnabled = true
-                }
-            }
-        }
+        self.addTarget(self, action: #selector(onTap(_:)), forControlEvents: .TouchUpInside)
     }
     
     func onTap(sender: AnyObject?) {

import Foundation
import UIKit

class CDAnimatedButton: UIButton {
    
    var onTapCallback: ((animatedButton: CDAnimatedButton?) -> Void)?
    
    override func didMoveToSuperview() {
        super.didMoveToSuperview()

}




