This commit is contained in:
Pfeil, Scott Robert 2020-03-23 16:58:45 -04:00
parent 8860ced85e
commit fec64291ee
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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() }) {