                 alpha = isHighlighted ? 0.5 : 1
             }
         }
-    }
-
-    override public var isSelected: Bool {
-        didSet {
-            refreshState()
-        }
-    }
-
-    override public func tintColorDidChange() {
-        refreshState()
     }
 
     override public func awakeFromNib() {

        }
    }

    public var onColor: UIColor = .systemBlue
    public var offColor: UIColor = .black

    override public var isHighlighted: Bool {
        didSet {


extension ActionButton {
    private func layout() {
        clipsToBounds = true

        backgroundColor = tintColor
        titleLabel.textColor = .black
        imageView.tintColor = titleLabel.textColor

        directionalLayoutMargins = NSDirectionalEdgeInsets(horizontal: 20, vertical: 12)

        let stackView = UIStackView(arrangedSubviews: [imageView, titleLabel])
        stackView.isUserInteractionEnabled = false
        stackView.spacing = UIStackView.spacingUseSystem
        stackView.translatesAutoresizingMaskIntoConstraints = false
        addSubview(stackView)

        stackView.fitVerticalEdgesToSuperview(obeyMargins: true)
        stackView.centerHorizontallyInSuperview()

        addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-(>=margin)-[stackView]-(>=margin)-|",
                                                      options: [],
                                                      metrics: ["margin": directionalLayoutMargins.leading],
                                                      views: ["stackView": stackView]))
    }
}
