         }
     }
     
-    override var selected: Bool {
+    override public var selected: Bool {
         didSet {
             selectionAnimation(selected)
         }

        }
    }
    
    @IBInspectable var borderWidth: CGFloat = 1
    @IBInspectable var checkmarkColor: UIColor = UIColor(white: 50 / 255, alpha: 1) {
        didSet {
            checkmarkLayer.strokeColor = checkmarkColor.CGColor
            layoutIfNeeded()
        }
    }
    @IBInspectable var checkmarkImage: UIImage? {
        didSet {
            checkmarkImageView.image = checkmarkImage
            layoutIfNeeded()
        }
    }
    @IBInspectable var checkmarkWidth: CGFloat = 1 {
        didSet {
            checkmarkLayer.lineWidth = checkmarkWidth
            layoutIfNeeded()
        }
    }
    @IBInspectable var image: UIImage? {
        didSet {
            backgroundView.image = image
            layoutIfNeeded()
        }
    }
    @IBInspectable var color: UIColor = UIColor.whiteColor() {
        didSet {
            backgroundView.backgroundColor = color
            layoutIfNeeded()
        }
    }
    
    override var frame: CGRect {
        didSet {
            let size = frame.size
            guard size.width != size.height else { return }

        darkOverlayLayer.addAnimation(opacityAnimation, forKey: "opacity")
    }
    
    private func selectionAnimation(selected: Bool) {
        let oldBorderWidth = layer.borderWidth
        layer.borderWidth = selected ? borderWidth : 0
        
