diff --git a/MVMCoreUI/Atoms/Buttons/Button.swift b/MVMCoreUI/Atoms/Buttons/Button.swift index 77a790fc..c1e631a2 100644 --- a/MVMCoreUI/Atoms/Buttons/Button.swift +++ b/MVMCoreUI/Atoms/Buttons/Button.swift @@ -29,13 +29,6 @@ public typealias ButtonBlock = (Button) -> Void self.titleLabel?.numberOfLines = 0 self.titleLabel?.lineBreakMode = .byWordWrapping - if let actionMap = self.actionMap, - let disableButtonAsAny = actionMap[KeyDisableButton], - let isDisabled = disableButtonAsAny as? Bool { - - isEnabled = !isDisabled - } - if let mVMCoreUIDelegateObject = delegateObject as? MVMCoreUIDelegateObject { self.buttonDelegate = mVMCoreUIDelegateObject.buttonDelegate } diff --git a/MVMCoreUI/Atoms/Buttons/CaretButton.swift b/MVMCoreUI/Atoms/Buttons/CaretButton.swift index 86f1185e..668505a8 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretButton.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretButton.swift @@ -123,6 +123,12 @@ open class CaretButton: Button, MVMCoreUIMoleculeViewProtocol, MVMCoreUIViewCons setTitle(title, for: .normal) } + if let disableButtonAsAny = dictionary[KeyDisableButton], + let isDisabled = disableButtonAsAny as? Bool { + + isEnabled = !isDisabled + } + if let backgroundColorHex = dictionary[KeyBackgroundColor] as? String { backgroundColor = UIColor.mfGet(forHex: backgroundColorHex) }