diff --git a/MVMCoreUI/Atoms/Buttons/CaretButton.swift b/MVMCoreUI/Atoms/Buttons/CaretButton.swift index af7d1d60..7d67afb1 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretButton.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretButton.swift @@ -109,23 +109,24 @@ open class CaretButton: MFCustomButton { @objc open override func setAsMolecule() { backgroundColor = .clear + setTitleColor(enabledColor, for: .normal) + setTitleColor(disabledColor, for: .disabled) } @objc override open func setWithJSON(_ json: [AnyHashable: Any]?, delegate: NSObject?, additionalData: [AnyHashable: Any]?) { - super.setWithJSON(json, delegate: delegate, additionalData: additionalData) + setWithActionMap(json, delegate: delegate as? (MVMCoreActionDelegateProtocol & NSObjectProtocol), additionalData: additionalData) - // Configure class properties with JSON values - guard let jsonDictionary = json else { return } + guard let dictionary = json else { return } - if let backgroundColorHex = jsonDictionary[KeyBackgroundColor] as? String { + if let backgroundColorHex = dictionary[KeyBackgroundColor] as? String { backgroundColor = UIColor.mfGet(forHex: backgroundColorHex) } - if let enableColorHex = jsonDictionary["enableColor"] as? String { - enabledColor = UIColor.mfGet(forHex: enableColorHex) + if let enabledColorHex = dictionary["enabledColor"] as? String { + enabledColor = UIColor.mfGet(forHex: enabledColorHex) } - if let disabledColorHex = jsonDictionary["disabledColor"] as? String { + if let disabledColorHex = dictionary["disabledColor"] as? String { disabledColor = UIColor.mfGet(forHex: disabledColorHex) } }