fix to mismatch

This commit is contained in:
Pfeil, Scott Robert 2019-05-28 16:00:00 -04:00
parent 1799f166ee
commit 59900d987a
2 changed files with 3 additions and 4 deletions

View File

@ -6,13 +6,12 @@
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
#import <UIKit/UIKit.h>
@class MVMCoreLoadObject;
@class MVMCoreUIDelegateObject;
@protocol MoleculeListCellProtocol <NSObject>
@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;

View File

@ -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)
}