diff --git a/MVMCoreUI/Templates/MoleculeListCellProtocol.h b/MVMCoreUI/Templates/MoleculeListCellProtocol.h index 3bc390f2..08ca2a37 100644 --- a/MVMCoreUI/Templates/MoleculeListCellProtocol.h +++ b/MVMCoreUI/Templates/MoleculeListCellProtocol.h @@ -6,13 +6,12 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // #import -@class MVMCoreLoadObject; @class MVMCoreUIDelegateObject; @protocol MoleculeListCellProtocol @optional /// Can override the molecule name for the given molecule. Otherwise we assume value for key moleculeName. -+ (nullable NSString *)moleculeName:(nullable NSDictionary *)molecule loadObject:(nullable MVMCoreLoadObject *)loadObject; ++ (nullable NSString *)moleculeName:(nullable NSDictionary *)molecule delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject; /// Can set the separator according to what the moleculeList commands. - (void)setSeparatorWithJSON:(nullable NSDictionary *)json delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData indexPath:(nonnull NSIndexPath *)indexPath; diff --git a/MVMCoreUI/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Templates/MoleculeListTemplate.swift index 11e3bddb..92805511 100644 --- a/MVMCoreUI/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Templates/MoleculeListTemplate.swift @@ -116,8 +116,8 @@ open class MoleculeListTemplate: ThreeLayerTableViewController { guard let map = molecule.molecule, let moleculeName = map.optionalStringForKey(KeyMoleculeName), let moleculeClass = MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping[moleculeName] as? AnyClass else { return nil } - if let moleculeClass = moleculeClass as? MoleculeListCellProtocol.Type, let moleculeName = moleculeClass.moleculeName { - return (moleculeName(map, loadObject), moleculeClass) + if let moleculeClass = moleculeClass as? MoleculeListCellProtocol.Type, let moleculeNameFunc = moleculeClass.moleculeName { + return (moleculeNameFunc(map, delegateObject() as? MVMCoreUIDelegateObject), moleculeClass) } else { return (moleculeName, moleculeClass) }