fill color

This commit is contained in:
Suresh, Kamlesh 2020-02-17 14:19:17 -05:00
parent cf4832bca7
commit 6de4fc4864
2 changed files with 6 additions and 7 deletions

View File

@ -88,13 +88,12 @@ public typealias ButtonAction = (Button) -> ()
// MARK:- ModelMoleculeViewProtocol
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.model = model
guard let model = model as? ButtonModelProtocol else { return }
isEnabled = model.enabled
if let backgroundColor = (model as? MoleculeModelProtocol)?.backgroundColor {
if let backgroundColor = model?.backgroundColor {
self.backgroundColor = backgroundColor.uiColor
}
guard let model = model as? ButtonModelProtocol else { return }
isEnabled = model.enabled
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
}

View File

@ -55,7 +55,7 @@ open class IsaacLandingTemplate: MoleculeListTemplate {
if let data = try? JSONSerialization.data(withJSONObject: buttonDict) {
let decoder = JSONDecoder()
twoButtonModel.primaryButton = try? decoder.decode(ButtonModel.self, from: data)
twoButtonModel.primaryButton?.backgroundColor = Color(uiColor: UIColor.mfGet(forHex: primaryButtonBGColor))
twoButtonModel.primaryButton?.fillColor = Color(uiColor: UIColor.mfGet(forHex: primaryButtonBGColor))
twoButtonModel.primaryButton?.textColor = Color(uiColor: UIColor.mfGet(forHex: primaryButtonTextColor))
}
}
@ -66,7 +66,7 @@ open class IsaacLandingTemplate: MoleculeListTemplate {
if let data = try? JSONSerialization.data(withJSONObject: buttonDict) {
let decoder = JSONDecoder()
twoButtonModel.secondaryButton = try? decoder.decode(ButtonModel.self, from: data)
twoButtonModel.secondaryButton?.backgroundColor = Color(uiColor: UIColor.mfGet(forHex: primaryButtonTextColor))
twoButtonModel.secondaryButton?.fillColor = Color(uiColor: UIColor.mfGet(forHex: primaryButtonTextColor))
twoButtonModel.secondaryButton?.textColor = Color(uiColor: UIColor.mfGet(forHex:primaryButtonBGColor))
}
}