cleanup
This commit is contained in:
parent
8860ced85e
commit
fec64291ee
@ -62,6 +62,8 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open override func handleNewData() {
|
open override func handleNewData() {
|
||||||
|
super.handleNewData()
|
||||||
|
|
||||||
// Removes the views
|
// Removes the views
|
||||||
topView?.removeFromSuperview()
|
topView?.removeFromSuperview()
|
||||||
middleView?.removeFromSuperview()
|
middleView?.removeFromSuperview()
|
||||||
@ -78,8 +80,6 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
heightConstraint?.isActive = false
|
heightConstraint?.isActive = false
|
||||||
|
|
||||||
setupLayers()
|
setupLayers()
|
||||||
|
|
||||||
super.handleNewData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK:-Functions to subclass
|
//MARK:-Functions to subclass
|
||||||
|
|||||||
@ -14,7 +14,7 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate {
|
|||||||
|
|
||||||
override open func handleNewData() {
|
override open func handleNewData() {
|
||||||
super.handleNewData()
|
super.handleNewData()
|
||||||
closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in
|
closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { _ in
|
||||||
MVMCoreNavigationHandler.shared()?.removeCurrentViewController()
|
MVMCoreNavigationHandler.shared()?.removeCurrentViewController()
|
||||||
}, verticalCentered: false)
|
}, verticalCentered: false)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,7 +162,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
|
|
||||||
open override func getIndexPath(for molecule: ListItemModelProtocol & MoleculeModelProtocol) -> IndexPath? {
|
open override func getIndexPath(for molecule: ListItemModelProtocol & MoleculeModelProtocol) -> IndexPath? {
|
||||||
guard let index = moleculesInfo?.firstIndex(where: { (moleculeInfo) -> Bool in
|
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()
|
let json = moleculeInfo.molecule.toJSON()
|
||||||
return json == molecule.toJSON()
|
return json == molecule.toJSON()
|
||||||
}) else { return nil }
|
}) else { return nil }
|
||||||
@ -192,7 +192,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
|
|
||||||
open override func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) {
|
open override func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) {
|
||||||
var indexPaths: [IndexPath] = []
|
var indexPaths: [IndexPath] = []
|
||||||
//TODO: check for molecule protocola equality
|
//TODO: check for molecule protocol equality
|
||||||
|
|
||||||
for molecule in molecules {
|
for molecule in molecules {
|
||||||
if let removeIndex = moleculesInfo?.firstIndex(where: { molecule.toJSON() == $0.molecule.toJSON() }) {
|
if let removeIndex = moleculesInfo?.firstIndex(where: { molecule.toJSON() == $0.molecule.toJSON() }) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user