57 lines
2.4 KiB
Swift
57 lines
2.4 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) -> MoleculeModelProtocol?
|
|
|
|
/// 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 addMolecules(_ molecules: [[AnyHashable : Any]], indexPath: IndexPath, animation: UITableView.RowAnimation)
|
|
|
|
func removeMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation)
|
|
|
|
//optional
|
|
func addMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation)
|
|
func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], 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 nothing
|
|
}
|
|
|
|
public func addMolecules(_ molecules: [[AnyHashable : Any]], indexPath: IndexPath, animation: UITableView.RowAnimation) {
|
|
// Do nothing
|
|
}
|
|
|
|
public func removeMolecules(_ molecules: [[AnyHashable : Any]], sender: UITableViewCell, animation: UITableView.RowAnimation) {
|
|
// Do nothing
|
|
}
|
|
|
|
public func addMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation) {
|
|
// Do nothing
|
|
}
|
|
|
|
public func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], sender: UITableViewCell, animation: UITableView.RowAnimation) {
|
|
// Do nothing
|
|
}
|
|
}
|