This commit is contained in:
Pfeil, Scott Robert 2020-01-16 18:54:01 -05:00
parent 48a8f4aba8
commit 8209101b73
5 changed files with 6 additions and 12 deletions

View File

@ -1,5 +1,5 @@
//
// StackItem.swift
// MoleculeStackItem.swift
// MVMCoreUI
//
// Created by Scott Pfeil on 12/13/19.

View File

@ -26,7 +26,7 @@ open class MoleculeStackView: Stack<MoleculeStackModel> {
override func createStackItemsFromModel(with delegate: MVMCoreUIDelegateObject?) {
guard let stackItemModels = stackModel?.molecules else { return }
for model in stackItemModels {
if let stackItem = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(model, delegate) as? StackItem {
if let stackItem = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(model, delegate) as? MoleculeStackItem {
stackItems.append(stackItem)
}
}

View File

@ -19,5 +19,6 @@ import UIKit
viewControllerMapping = MVMCoreUIViewControllerMappingObject()
loggingDelegate = MVMCoreUILoggingHandler()
moleculeMap = MVMCoreUIMoleculeMappingObject()
MoleculeObjectMapping.registerObjects()
}
}

View File

@ -70,10 +70,9 @@
@"tabsListItem": TabsTableViewCell.class,
@"dropDownListItem": DropDownFilterTableViewCell.class,
@"headlineBodyButton": HeadlineBodyButton.class,
@"stackItem": StackItem.class,
@"stackItem": MoleculeStackItem.class,
@"eyebrowHeadlineBodyLink": EyebrowHeadlineBodyLink.class,
@"headlineBodyCaretLinkImage" : HeadLineBodyCaretLinkImage.class,
@"stackItem": StackItem.class,
@"doughnutChart": DoughnutChartView.class,
@"headLineBodyCaretLinkImage" : HeadLineBodyCaretLinkImage.class
} mutableCopy];
@ -85,13 +84,6 @@
return [MVMCoreActionUtility initializerClassCheck:[CoreUIObject sharedInstance].moleculeMap classToVerify:self];
}
- (instancetype)init {
if (self = [super init]) {
[MoleculeObjectMapping registerObjects];
}
return self;
}
- (nullable Class)getMoleculeClassWithJSON:(nonnull NSDictionary *)json {
NSString *moleculeName = [json string:KeyMoleculeName];
if (moleculeName) {

View File

@ -10,7 +10,8 @@ import Foundation
@objcMembers public class MoleculeObjectMapping: NSObject {
public static func registerObjects() {
MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MoleculeStackView.self, forKey: "stack" as NSString)
let mapping = MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping
mapping?.setObject(MoleculeStackView.self, forKey: "stack" as NSString)
ModelRegistry.register(LabelModel.self)
ModelRegistry.register(HeaderModel.self)