From fec64291ee7a25996a5dd0fd01359ae4ef72f463 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 23 Mar 2020 16:58:45 -0400 Subject: [PATCH] cleanup --- MVMCoreUI/BaseControllers/ThreeLayerViewController.swift | 4 ++-- MVMCoreUI/Templates/ModalMoleculeListTemplate.swift | 2 +- MVMCoreUI/Templates/MoleculeListTemplate.swift | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ThreeLayerViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerViewController.swift index bf557814..9eacd25c 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerViewController.swift @@ -62,6 +62,8 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController { } open override func handleNewData() { + super.handleNewData() + // Removes the views topView?.removeFromSuperview() middleView?.removeFromSuperview() @@ -78,8 +80,6 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController { heightConstraint?.isActive = false setupLayers() - - super.handleNewData() } //MARK:-Functions to subclass diff --git a/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift index 7c62faab..eda35d6b 100644 --- a/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift @@ -14,7 +14,7 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { override open func handleNewData() { super.handleNewData() - closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in + closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { _ in MVMCoreNavigationHandler.shared()?.removeCurrentViewController() }, verticalCentered: false) } diff --git a/MVMCoreUI/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Templates/MoleculeListTemplate.swift index d68a1170..073d234c 100644 --- a/MVMCoreUI/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Templates/MoleculeListTemplate.swift @@ -162,7 +162,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol open override func getIndexPath(for molecule: ListItemModelProtocol & MoleculeModelProtocol) -> IndexPath? { guard let index = moleculesInfo?.firstIndex(where: { (moleculeInfo) -> Bool in - //TODO: check for molecule protocola eqaulity + //TODO: check for molecule protocol eqaulity let json = moleculeInfo.molecule.toJSON() return json == molecule.toJSON() }) else { return nil } @@ -192,7 +192,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol open override func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) { var indexPaths: [IndexPath] = [] - //TODO: check for molecule protocola equality + //TODO: check for molecule protocol equality for molecule in molecules { if let removeIndex = moleculesInfo?.firstIndex(where: { molecule.toJSON() == $0.molecule.toJSON() }) {