fill color
This commit is contained in:
parent
cf4832bca7
commit
6de4fc4864
@ -88,13 +88,12 @@ public typealias ButtonAction = (Button) -> ()
|
|||||||
// MARK:- ModelMoleculeViewProtocol
|
// MARK:- ModelMoleculeViewProtocol
|
||||||
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
self.model = model
|
self.model = model
|
||||||
|
if let backgroundColor = model?.backgroundColor {
|
||||||
|
self.backgroundColor = backgroundColor.uiColor
|
||||||
|
}
|
||||||
|
|
||||||
guard let model = model as? ButtonModelProtocol else { return }
|
guard let model = model as? ButtonModelProtocol else { return }
|
||||||
isEnabled = model.enabled
|
isEnabled = model.enabled
|
||||||
|
|
||||||
if let backgroundColor = (model as? MoleculeModelProtocol)?.backgroundColor {
|
|
||||||
self.backgroundColor = backgroundColor.uiColor
|
|
||||||
}
|
|
||||||
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ open class IsaacLandingTemplate: MoleculeListTemplate {
|
|||||||
if let data = try? JSONSerialization.data(withJSONObject: buttonDict) {
|
if let data = try? JSONSerialization.data(withJSONObject: buttonDict) {
|
||||||
let decoder = JSONDecoder()
|
let decoder = JSONDecoder()
|
||||||
twoButtonModel.primaryButton = try? decoder.decode(ButtonModel.self, from: data)
|
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))
|
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) {
|
if let data = try? JSONSerialization.data(withJSONObject: buttonDict) {
|
||||||
let decoder = JSONDecoder()
|
let decoder = JSONDecoder()
|
||||||
twoButtonModel.secondaryButton = try? decoder.decode(ButtonModel.self, from: data)
|
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))
|
twoButtonModel.secondaryButton?.textColor = Color(uiColor: UIColor.mfGet(forHex:primaryButtonBGColor))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user