Code commit after adding a createPayPal function.
This commit is contained in:
parent
273b131714
commit
c43a3da712
@ -36,7 +36,6 @@ import Foundation
|
|||||||
stack.stackItems = [StackItem(andContain: leftLabel),StackItem(andContain: rightImage)]
|
stack.stackItems = [StackItem(andContain: leftLabel),StackItem(andContain: rightImage)]
|
||||||
contentView.addSubview(stack)
|
contentView.addSubview(stack)
|
||||||
containerHelper.constrainView(stack)
|
containerHelper.constrainView(stack)
|
||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
@ -45,7 +44,7 @@ import Foundation
|
|||||||
super.reset()
|
super.reset()
|
||||||
stack.reset()
|
stack.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
super.setWithModel(model, delegateObject, additionalData)
|
super.setWithModel(model, delegateObject, additionalData)
|
||||||
guard let model = model as? ListRightVariablePaymentsModel else { return}
|
guard let model = model as? ListRightVariablePaymentsModel else { return}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtoco
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
func createPayPalImage() -> ImageViewModel {
|
static func createPayPalImage() -> ImageViewModel {
|
||||||
let image = ImageViewModel(image: "imagename_paypal")
|
let image = ImageViewModel(image: "imagename_paypal")
|
||||||
image.width = 30.0
|
image.width = 30.0
|
||||||
return image
|
return image
|
||||||
@ -35,7 +35,7 @@ public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtoco
|
|||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
||||||
image = try typeContainer.decodeIfPresent(ImageViewModel.self, forKey: .image) ?? createPayPalImage()
|
image = try typeContainer.decodeIfPresent(ImageViewModel.self, forKey: .image) ?? ListRightVariablePaymentsModel.createPayPalImage()
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user