Removes disabled logic from Button because it won't be in the actionMap going forward

This commit is contained in:
Robinson, Blake 2019-12-19 10:19:42 -05:00
parent 2c5e2286b1
commit 8f23dd391c
2 changed files with 6 additions and 7 deletions

View File

@ -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
}

View File

@ -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)
}