From 8f23dd391c338f3a41d2fbc9831f30451047c3f9 Mon Sep 17 00:00:00 2001 From: "Robinson, Blake" Date: Thu, 19 Dec 2019 10:19:42 -0500 Subject: [PATCH] Removes disabled logic from Button because it won't be in the actionMap going forward --- MVMCoreUI/Atoms/Buttons/Button.swift | 7 ------- MVMCoreUI/Atoms/Buttons/CaretButton.swift | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) 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) }