From 5d23b8329fff94bff735607731cf971c0d23e253 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 23 Jan 2020 12:54:34 -0500 Subject: [PATCH] list item fix --- MVMCoreUI/Molecules/Items/MoleculeTableViewCell.swift | 8 +++++--- MVMCoreUI/Molecules/Items/TableViewCell.swift | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Molecules/Items/MoleculeTableViewCell.swift b/MVMCoreUI/Molecules/Items/MoleculeTableViewCell.swift index f55f9645..56ff1ca9 100644 --- a/MVMCoreUI/Molecules/Items/MoleculeTableViewCell.swift +++ b/MVMCoreUI/Molecules/Items/MoleculeTableViewCell.swift @@ -13,12 +13,14 @@ import UIKit // MARK: - MVMCoreUIMoleculeViewProtocol public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { super.setWithModel(model, delegateObject, additionalData) - guard let moleculeModel = (model as? ListItemModel)?.molecule else { return } + guard let model = model as? ListItemModel else { return } if molecule != nil { - (molecule as? ModelMoleculeViewProtocol)?.setWithModel(moleculeModel, delegateObject, additionalData) - } else if let moleculeView = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(moleculeModel, delegateObject, false) { + (molecule as? ModelMoleculeViewProtocol)?.setWithModel(model.molecule, delegateObject, additionalData) + } else if let moleculeView = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(model.molecule, delegateObject, false) { addMolecule(moleculeView) } + + containerHelper.set(with: model, for: molecule as? MVMCoreUIViewConstrainingProtocol) } public override class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? { diff --git a/MVMCoreUI/Molecules/Items/TableViewCell.swift b/MVMCoreUI/Molecules/Items/TableViewCell.swift index 900e6dd0..9daec27d 100644 --- a/MVMCoreUI/Molecules/Items/TableViewCell.swift +++ b/MVMCoreUI/Molecules/Items/TableViewCell.swift @@ -168,9 +168,6 @@ import UIKit addSeparatorsIfNeeded() bottomSeparatorView?.setWithModel(separator, nil, nil) } - - guard let molecule = molecule else { return } - containerHelper.set(with: model, for: molecule as? MVMCoreUIViewConstrainingProtocol) } open func reset() {