mvm_core_ui/MVMCoreUI/OtherHandlers/ModelMoleculeDelegateProtocol.swift
Pfeil, Scott Robert 5bb6b9bc75 Line items update
2020-01-13 09:38:39 -05:00

47 lines
2.0 KiB
Swift

//
// MoleculeDelegateProtocol.swift
// MVMCoreUI
//
// Created by Suresh, Kamlesh on 11/26/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import Foundation
public protocol MoleculeDelegateProtocol {
/// returns a module for the corresponding module name.
func getModuleWithName(_ name: String?) -> [AnyHashable : Any]?
func getModuleWithName(_ moleculeName: String) -> MoleculeProtocol?
/// Notifies the delegate that the molecule layout update. Should be called when the layout may change due to an async method.
func moleculeLayoutUpdated(_ molecule: UIView & MVMCoreUIMoleculeViewProtocol) //optional
/// Asks the delegate to add or remove molecules.
//optional
func addMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation)
func removeMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation)
//optional
func addMolecules(_ molecules: [ListItemModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation)
func removeMolecules(_ molecules: [ListItemModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation)
}
extension MoleculeDelegateProtocol {
public func moleculeLayoutUpdated(_ molecule: UIView & MVMCoreUIMoleculeViewProtocol) {
// Do Nothing
}
public func addMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation) {
// Do nothpublic ing
}
public func removeMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation) {
// Do nothing
}
public func addMolecules(_ molecules: [ListItemModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation) {
// Do nothpublic ing
}
public func removeMolecules(_ molecules: [ListItemModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation) {
// Do nothing
}
}