corner label bug fixes: CXTDT-54851 & CXTDT-4571(see comments)
making molecule optional as per one confluence document. Same has been implemented in Android and Server.
This commit is contained in:
parent
5c890818aa
commit
fa1c8bad92
@ -171,10 +171,8 @@ import UIKit
|
|||||||
guard let model = model as? CornerLabelsModel else { return }
|
guard let model = model as? CornerLabelsModel else { return }
|
||||||
if middleView != nil {
|
if middleView != nil {
|
||||||
(middleView as? ModelMoleculeViewProtocol)?.setWithModel(model, delegateObject, additionalData)
|
(middleView as? ModelMoleculeViewProtocol)?.setWithModel(model, delegateObject, additionalData)
|
||||||
} else {
|
} else if let moleculeModel = model.molecule, let molecule = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(moleculeModel, delegateObject) {
|
||||||
if let molecule = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(model.molecule, delegateObject) {
|
addMiddleView(molecule)
|
||||||
addMiddleView(molecule)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
topLeftLabel.setWithModel(model.topLeftLabel, delegateObject, additionalData)
|
topLeftLabel.setWithModel(model.topLeftLabel, delegateObject, additionalData)
|
||||||
|
|||||||
@ -15,9 +15,9 @@ public class CornerLabelsModel: MoleculeModelProtocol {
|
|||||||
public var topRightLabel: LabelModel?
|
public var topRightLabel: LabelModel?
|
||||||
public var bottomLeftLabel: LabelModel?
|
public var bottomLeftLabel: LabelModel?
|
||||||
public var bottomRightLabel: LabelModel?
|
public var bottomRightLabel: LabelModel?
|
||||||
public var molecule: MoleculeModelProtocol
|
public var molecule: MoleculeModelProtocol?
|
||||||
|
|
||||||
init(with molecule: MoleculeModelProtocol) {
|
init(with molecule: MoleculeModelProtocol?) {
|
||||||
self.molecule = molecule
|
self.molecule = molecule
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ public class CornerLabelsModel: MoleculeModelProtocol {
|
|||||||
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)
|
||||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||||
molecule = try typeContainer.decodeMolecule(codingKey: .molecule)
|
molecule = try typeContainer.decodeMoleculeIfPresent(codingKey: .molecule)
|
||||||
topLeftLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .topLeftLabel)
|
topLeftLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .topLeftLabel)
|
||||||
topRightLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .topRightLabel)
|
topRightLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .topRightLabel)
|
||||||
bottomLeftLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .bottomLeftLabel)
|
bottomLeftLabel = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .bottomLeftLabel)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user