 import Foundation
 import UIKit
 
+//UIButton
 class EYFlatButton: UIButton {
     var title:String?
     var color:EYFlatColorType!

    
    override func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) -> Bool {
        println("beginTrackingWithTouch")
        UIView.animateWithDuration(0.1,
            animations: {
                self.mask.alpha = 0.5
            }, completion: nil)
        return super.beginTrackingWithTouch(touch, withEvent: event)
    }
    
    override func endTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) {
        UIView.animateWithDuration(0.1,
            animations: {
                self.mask.alpha = 0
            }, completion: nil)
        return super.endTrackingWithTouch(touch, withEvent: event)
    }
}

        
        self.mask = UIView()
        let hexColor = UIColor(rgba: color.rawValue)
        self.mask.backgroundColor = UIColor(white: 0.8, alpha: 0.8)
        self.mask.frame = bounds
        self.mask.alpha = 0
        self.layer.addSublayer(self.mask.layer)
