review comment update, updated the function name
This commit is contained in:
parent
f853275005
commit
0f56803a5d
@ -204,8 +204,8 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
||||
open func newData(for molecule: MoleculeModelProtocol) {
|
||||
|
||||
//Check header and footer if replace happens then return.
|
||||
if updateMoleculeViewById(topView, with: molecule) ||
|
||||
updateMoleculeViewById(bottomView, with: molecule, isHeader: false) {
|
||||
if updateHeaderFooterView(topView, with: molecule) ||
|
||||
updateHeaderFooterView(bottomView, with: molecule, isHeader: false) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -228,12 +228,12 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
||||
}
|
||||
}
|
||||
|
||||
///Helper functions to update view with molecule
|
||||
private func updateMoleculeViewById(_ view: UIView?, with molecule: MoleculeModelProtocol, isHeader: Bool = true) -> Bool {
|
||||
///Helper functions to update header/footer view
|
||||
private func updateHeaderFooterView(_ view: UIView?, with molecule: MoleculeModelProtocol, isHeader: Bool = true) -> Bool {
|
||||
if let updateView = view,
|
||||
let moleculeView = MVMCoreUIUtility.findViews(by: MoleculeViewProtocol.self, views: [updateView]).first(where: { $0.model?.moleculeName == molecule.moleculeName && $0.model?.id == molecule.id }) {
|
||||
updateMoleculeView(moleculeView, from: molecule)
|
||||
//Redraw the header and footer for content update
|
||||
//Redraw the header/footer for content update
|
||||
isHeader ? showHeader(nil) : showFooter(nil)
|
||||
return true
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user