 private class BHProgressHUDRoundedButton: UIButton {
     
     override var highlighted: Bool {
-        didSet {
+        willSet {
             let baseColor = self.titleColorForState(.Selected)
-            backgroundColor = highlighted ? baseColor?.colorWithAlphaComponent(0.1) : UIColor.clearColor()
-        }
-        
-//        set {
-//            let baseColor = self.titleColorForState(.Selected)
-//            backgroundColor = newValue ? baseColor?.colorWithAlphaComponent(0.1) : UIColor.clearColor()
-//        }
-//        get {
-//            return self.highlighted
-//        }
+            backgroundColor = newValue == true ? baseColor?.colorWithAlphaComponent(0.1) : UIColor.clearColor()
+        }
     }
     
     override init(frame: CGRect) {

        }
    }
    
    func applyPriority(priority: UILayoutPriority, toConstraints: [NSLayoutConstraint]) {
        for constraint in constraints {
            constraint.priority = priority
        }

        
        // Ensure minimum side margin is kept
        var sideContraints = [NSLayoutConstraint]()
        sideContraints.appendContentsOf(NSLayoutConstraint.constraintsWithVisualFormat("|-(>=margin)-[bezel]-(>=margin)-|", options: [], metrics: metrics, views: ["bezel" : bezelView!]))
        sideContraints.appendContentsOf(NSLayoutConstraint.constraintsWithVisualFormat("V:|-(>=margin)-[bezel]-(>=margin)-|", options: [], metrics: metrics, views: ["bezel" : bezelView!]))
        self.applyPriority(999.0, toConstraints: sideContraints)
        self.addConstraints(sideContraints)
        
