fix to typos
This commit is contained in:
parent
d196aa3cef
commit
48a940f160
@ -64,7 +64,7 @@ import UIKit
|
|||||||
primaryButton?.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
primaryButton?.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 42
|
return 42
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,7 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol, MVMCoreUI
|
|||||||
return UIStackView.Alignment.leading;
|
return UIStackView.Alignment.leading;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 10
|
return 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,7 +215,7 @@ import UIKit
|
|||||||
pinEdges(.all)
|
pinEdges(.all)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return json?.optionalCGFloatForKey("height") ?? 0
|
return json?.optionalCGFloatForKey("height") ?? 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ typedef void(^ValueChangeBlock)(void);
|
|||||||
|
|
||||||
@property (nonatomic) BOOL shouldTouchToSwitch;
|
@property (nonatomic) BOOL shouldTouchToSwitch;
|
||||||
@property (nullable, copy, nonatomic) ValueChangeBlock valueChangedBlock;
|
@property (nullable, copy, nonatomic) ValueChangeBlock valueChangedBlock;
|
||||||
|
@property (nullable, copy, nonatomic) ValueChangeBlock actionBlock;
|
||||||
|
|
||||||
+ (nonnull instancetype)mvmSwitchDefault;
|
+ (nonnull instancetype)mvmSwitchDefault;
|
||||||
+ (nonnull instancetype)mvmSwitchDefaultWithValueChangeBlock:(nullable ValueChangeBlock)block;
|
+ (nonnull instancetype)mvmSwitchDefaultWithValueChangeBlock:(nullable ValueChangeBlock)block;
|
||||||
|
|||||||
@ -145,6 +145,7 @@ const CGFloat SwitchShakeIntensity = 2;
|
|||||||
|
|
||||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||||
self.json = json;
|
self.json = json;
|
||||||
|
self.delegate = delegateObject;
|
||||||
|
|
||||||
[FormValidator setupValidationWithMolecule:self delegate:delegateObject.formValidationProtocol];
|
[FormValidator setupValidationWithMolecule:self delegate:delegateObject.formValidationProtocol];
|
||||||
|
|
||||||
@ -169,6 +170,17 @@ const CGFloat SwitchShakeIntensity = 2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self setState:[json boolForKey:@"state"] animated:false];
|
[self setState:[json boolForKey:@"state"] animated:false];
|
||||||
|
|
||||||
|
NSDictionary *actionMap = [json dict:@"actionMap"];
|
||||||
|
if (actionMap) {
|
||||||
|
[self addTarget:self action:@selector(addCustomAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addCustomAction {
|
||||||
|
if (self.actionBlock) {
|
||||||
|
self.actionBlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (CGFloat)estimatedHeightForRow:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject {
|
+ (CGFloat)estimatedHeightForRow:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject {
|
||||||
|
|||||||
@ -73,7 +73,7 @@ import Foundation
|
|||||||
trackTintColor = UIColor.mfLightSilver()
|
trackTintColor = UIColor.mfLightSilver()
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 8
|
return 8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,7 +91,7 @@ import UIKit
|
|||||||
imageLoader.updateView(size)
|
imageLoader.updateView(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 197
|
return 197
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ import UIKit
|
|||||||
imageView.reset()
|
imageView.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 95
|
return 95
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -221,7 +221,7 @@ import UIKit
|
|||||||
backgroundColor = .white
|
backgroundColor = .white
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public class func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
guard let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) else {
|
guard let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) else {
|
||||||
return 80
|
return 80
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,7 +174,7 @@ import UIKit
|
|||||||
bottomRightLabel.styleB3(true)
|
bottomRightLabel.styleB3(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 34
|
return 34
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ import UIKit
|
|||||||
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 30
|
return 30
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ import UIKit
|
|||||||
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return HeadlineBodyTextButton.estimatedHeight(forRow: json, delegateObject: delegateObject)
|
return HeadlineBodyTextButton.estimatedHeight(forRow: json, delegateObject: delegateObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ import UIKit
|
|||||||
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("switch"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return MVMCoreUISwitch.estimatedHeight(forRow: json, delegateObject: delegateObject)
|
return MVMCoreUISwitch.estimatedHeight(forRow: json, delegateObject: delegateObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ open class ModuleMolecule: ViewConstrainingView {
|
|||||||
moduleMolecule?.reset?()
|
moduleMolecule?.reset?()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
guard let moduleName = json?.optionalStringForKey("moduleName"), let module = delegateObject?.moleculeDelegate?.getModuleWithName(moduleName) else {
|
guard let moduleName = json?.optionalStringForKey("moduleName"), let module = delegateObject?.moleculeDelegate?.getModuleWithName(moduleName) else {
|
||||||
// Critical error
|
// Critical error
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@ -26,7 +26,7 @@ open class StandardFooterView: ViewConstrainingView {
|
|||||||
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false)
|
(molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
||||||
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class StandardHeaderView: ViewConstrainingView {
|
|||||||
separatorView?.show()
|
separatorView?.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) {
|
||||||
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ import UIKit
|
|||||||
body.styleB2(true)
|
body.styleB2(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 65
|
return 65
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,7 +136,7 @@ open class HeadlineBody: ViewConstrainingView {
|
|||||||
stylePageHeader()
|
stylePageHeader()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 58
|
return 58
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ import UIKit
|
|||||||
textButton.reset()
|
textButton.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 60
|
return 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -199,7 +199,7 @@ public class MoleculeStackView: ViewConstrainingView {
|
|||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
guard let items = json?.optionalArrayForKey(KeyMolecules) else {
|
guard let items = json?.optionalArrayForKey(KeyMolecules) else {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
mapping = [@{
|
mapping = [@{
|
||||||
@"label": Label.class,
|
@"label": Label.class,
|
||||||
@"separator": SeparatorView.class,
|
@"line": SeparatorView.class,
|
||||||
@"button": ButtonView.class,
|
@"button": ButtonView.class,
|
||||||
@"textButton": MFTextButton.class,
|
@"textButton": MFTextButton.class,
|
||||||
@"header": StandardHeaderView.class,
|
@"header": StandardHeaderView.class,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user