Change keys

This commit is contained in:
Pfeil, Scott Robert 2020-01-13 15:26:51 -05:00
parent 788145332f
commit 57753f6697
11 changed files with 20 additions and 22 deletions

View File

@ -454,7 +454,7 @@ import MVMCore
isEnabled(enabled) isEnabled(enabled)
} }
if let actionMap = dictionary.optionalDictionaryForKey("actionMap") { if let actionMap = dictionary.optionalDictionaryForKey("action") {
actionBlock = { MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: additionalData, delegateObject: delegateObject) } actionBlock = { MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: additionalData, delegateObject: delegateObject) }
} }
} }

View File

@ -171,7 +171,7 @@ const CGFloat SwitchShakeIntensity = 2;
[self setState:[json boolForKey:@"state"] animated:false]; [self setState:[json boolForKey:@"state"] animated:false];
NSDictionary *actionMap = [json dict:@"actionMap"]; NSDictionary *actionMap = [json dict:@"action"];
if (actionMap) { if (actionMap) {
[self addTarget:self action:@selector(addCustomAction) forControlEvents:UIControlEventTouchUpInside]; [self addTarget:self action:@selector(addCustomAction) forControlEvents:UIControlEventTouchUpInside];
} }

View File

@ -10,7 +10,7 @@ import Foundation
@objcMembers public class StackPageTemplateModel: TemplateModelProtocol { @objcMembers public class StackPageTemplateModel: TemplateModelProtocol {
public static var identifier: String = "moleculeStack" public static var identifier: String = "stack"
public var pageType: String public var pageType: String

View File

@ -39,8 +39,6 @@ import UIKit
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData) super.setWithModel(model, delegateObject, additionalData)
// guard let headlineModel = model as? headlinebodyswitch
// headlineBody.setWithModel(mode, <#T##delegateObject: MVMCoreUIDelegateObject?##MVMCoreUIDelegateObject?#>, <#T##additionalData: [String : AnyHashable]?##[String : AnyHashable]?#>)
} }
public static func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { public static func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
@ -52,7 +50,7 @@ import UIKit
open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData) headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData)
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData) mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("toggle"), delegateObject: delegateObject, additionalData: additionalData)
} }
open class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { open class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {

View File

@ -37,8 +37,8 @@ import UIKit
// MARK: - MVMCoreUIMoleculeViewProtocol // MARK: - MVMCoreUIMoleculeViewProtocol
public override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { public override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
headlineBodyTextButton.setWithJSON(json?.optionalDictionaryForKey("headlineBodyTextButton"), delegateObject: delegateObject, additionalData: additionalData) headlineBodyTextButton.setWithJSON(json?.optionalDictionaryForKey("headlineBodyLink"), delegateObject: delegateObject, additionalData: additionalData)
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData) mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("toggle"), delegateObject: delegateObject, additionalData: additionalData)
} }
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {

View File

@ -38,7 +38,7 @@ import UIKit
public override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { public override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
label.setWithJSON(json?.optionalDictionaryForKey("label"), delegateObject: delegateObject, additionalData: additionalData) label.setWithJSON(json?.optionalDictionaryForKey("label"), delegateObject: delegateObject, additionalData: additionalData)
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData) mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("toggle"), delegateObject: delegateObject, additionalData: additionalData)
} }
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {

View File

@ -37,7 +37,7 @@ public class StandardHeaderView: MoleculeContainer {
// MARK: - MVMCoreUIMoleculeViewProtocol // MARK: - MVMCoreUIMoleculeViewProtocol
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
if let separatorJSON = json?.optionalDictionaryForKey("separator") { if let separatorJSON = json?.optionalDictionaryForKey("line") {
line?.setWithJSON(separatorJSON, delegateObject: delegateObject, additionalData: additionalData) line?.setWithJSON(separatorJSON, delegateObject: delegateObject, additionalData: additionalData)
} }
} }

View File

@ -66,7 +66,7 @@ import UIKit
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData) headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData)
textButton.setWithJSON(json?.optionalDictionaryForKey("textButton"), delegateObject: delegateObject, additionalData: additionalData) textButton.setWithJSON(json?.optionalDictionaryForKey("link"), delegateObject: delegateObject, additionalData: additionalData)
} }
open override func reset() { open override func reset() {

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
@objcMembers public class MoleculeStackModel: ContainerModel, MoleculeProtocol { @objcMembers public class MoleculeStackModel: ContainerModel, MoleculeProtocol {
public static var identifier: String = "moleculeStack" public static var identifier: String = "stack"
public var backgroundColor: Color? public var backgroundColor: Color?
public var molecules: [StackItemModel] public var molecules: [StackItemModel]
public var axis: NSLayoutConstraint.Axis = .vertical public var axis: NSLayoutConstraint.Axis = .vertical

View File

@ -29,9 +29,9 @@
@"label": Label.class, @"label": Label.class,
@"line": Line.class, @"line": Line.class,
@"button": PrimaryButton.class, @"button": PrimaryButton.class,
@"textButton": MFTextButton.class, @"link": MFTextButton.class,
@"header": StandardHeaderView.class, @"header": StandardHeaderView.class,
@"moleculeStack": MoleculeStackView.class, @"stack": MoleculeStackView.class,
@"twoButtonView": TwoButtonView.class, @"twoButtonView": TwoButtonView.class,
@"footer": StandardFooterView.class, @"footer": StandardFooterView.class,
@"caretView": CaretView.class, @"caretView": CaretView.class,
@ -40,7 +40,7 @@
@"dropDown": DropDown.class, @"dropDown": DropDown.class,
@"digitTextField": MFDigitTextField.class, @"digitTextField": MFDigitTextField.class,
@"checkbox": Checkbox.class, @"checkbox": Checkbox.class,
@"checkboxWithLabel": CheckboxWithLabelView.class, @"checkboxLabel": CheckboxWithLabelView.class,
@"cornerLabels" : CornerLabels.class, @"cornerLabels" : CornerLabels.class,
@"progressbar": ProgressBar.class, @"progressbar": ProgressBar.class,
@"circleProgress": GraphView.class, @"circleProgress": GraphView.class,
@ -49,7 +49,7 @@
@"radioButtonLabel": RadioButtonLabel.class, @"radioButtonLabel": RadioButtonLabel.class,
@"listItem": MoleculeTableViewCell.class, @"listItem": MoleculeTableViewCell.class,
@"accordionListItem": AccordionMoleculeTableViewCell.class, @"accordionListItem": AccordionMoleculeTableViewCell.class,
@"switch": MVMCoreUISwitch.class, @"toggle": MVMCoreUISwitch.class,
@"leftRightLabelView": LeftRightLabelView.class, @"leftRightLabelView": LeftRightLabelView.class,
@"actionDetailWithImage": ActionDetailWithImage.class, @"actionDetailWithImage": ActionDetailWithImage.class,
@"image": MFLoadImageView.class, @"image": MFLoadImageView.class,
@ -60,10 +60,10 @@
@"barsPager": MVMCoreUIPageControl.class, @"barsPager": MVMCoreUIPageControl.class,
@"scroller": Scroller.class, @"scroller": Scroller.class,
@"imageHeadlineBody": ImageHeadlineBody.class, @"imageHeadlineBody": ImageHeadlineBody.class,
@"labelSwitch": LabelSwitch.class, @"labelToggle": LabelSwitch.class,
@"headlineBodySwitch": HeadlineBodySwitch.class, @"headlineBodyToggle": HeadlineBodySwitch.class,
@"headlineBodyTextButton": HeadlineBodyTextButton.class, @"headlineBodyLink": HeadlineBodyTextButton.class,
@"headlineBodyTextButtonSwitch": HeadlineBodyTextButtonSwitch.class, @"headlineBodyLinkToggle": HeadlineBodyTextButtonSwitch.class,
@"tabsListItem": TabsTableViewCell.class, @"tabsListItem": TabsTableViewCell.class,
@"dropDownListItem": DropDownFilterTableViewCell.class, @"dropDownListItem": DropDownFilterTableViewCell.class,
@"headlineBodyButton": HeadlineBodyButton.class, @"headlineBodyButton": HeadlineBodyButton.class,

View File

@ -19,9 +19,9 @@
static NSMutableDictionary *viewControllerMapping; static NSMutableDictionary *viewControllerMapping;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
viewControllerMapping = [@{ viewControllerMapping = [@{
@"moleculeStack" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeStackTemplate class]], @"stack" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeStackTemplate class]],
@"centerMoleculeStack" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeStackCenteredTemplate class]], @"centerMoleculeStack" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeStackCenteredTemplate class]],
@"moleculeList" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeListTemplate class]], @"list" : [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[MoleculeListTemplate class]],
@"threeLayer" : @"threeLayer" :
[[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[ThreeLayerTemplate class]] [[MVMCoreViewControllerProgrammaticMappingObject alloc] initWithClass:[ThreeLayerTemplate class]]
} mutableCopy]; } mutableCopy];