Merge branch 'develop' into feature/kevin
This commit is contained in:
commit
5b1520bc44
@ -7,8 +7,13 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618A224BBE7700E1557D /* FormValidator.swift */; };
|
||||||
|
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */; };
|
||||||
|
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */; };
|
||||||
|
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0198F79E225679870066C936 /* FormValidationProtocol.swift */; };
|
||||||
01DF55E021F8FAA800CC099B /* MFTextFieldListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */; };
|
01DF55E021F8FAA800CC099B /* MFTextFieldListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */; };
|
||||||
01DF567021FA5AB300CC099B /* TextFieldListFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */; };
|
01DF567021FA5AB300CC099B /* TextFieldListFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */; };
|
||||||
|
01E569D3223FFFA500327251 /* ThreeLayerViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationController.m */; };
|
D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationController.m */; };
|
||||||
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */; };
|
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */; };
|
||||||
@ -157,6 +162,10 @@
|
|||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
0105618A224BBE7700E1557D /* FormValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidator.swift; sourceTree = "<group>"; };
|
||||||
|
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+TextFields.swift"; sourceTree = "<group>"; };
|
||||||
|
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+FormParams.swift"; sourceTree = "<group>"; };
|
||||||
|
0198F79E225679870066C936 /* FormValidationProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidationProtocol.swift; sourceTree = "<group>"; };
|
||||||
01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFTextFieldListView.swift; sourceTree = "<group>"; };
|
01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFTextFieldListView.swift; sourceTree = "<group>"; };
|
||||||
01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldListFormViewController.swift; sourceTree = "<group>"; };
|
01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldListFormViewController.swift; sourceTree = "<group>"; };
|
||||||
D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationController.h; sourceTree = "<group>"; };
|
D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationController.h; sourceTree = "<group>"; };
|
||||||
@ -323,6 +332,17 @@
|
|||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
|
01C74D87224298E2009C25A3 /* FormUIHelpers */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
0198F79E225679870066C936 /* FormValidationProtocol.swift */,
|
||||||
|
0105618A224BBE7700E1557D /* FormValidator.swift */,
|
||||||
|
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */,
|
||||||
|
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */,
|
||||||
|
);
|
||||||
|
path = FormUIHelpers;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
D22D1F582204D2590077CEC0 /* LegacyControllers */ = {
|
D22D1F582204D2590077CEC0 /* LegacyControllers */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -356,6 +376,7 @@
|
|||||||
D29DF0CE21E404D4003B2FB9 /* MVMCoreUI */ = {
|
D29DF0CE21E404D4003B2FB9 /* MVMCoreUI */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
01C74D87224298E2009C25A3 /* FormUIHelpers */,
|
||||||
D29DF31421ECECA7003B2FB9 /* SupportingFiles */,
|
D29DF31421ECECA7003B2FB9 /* SupportingFiles */,
|
||||||
D29DF27021E79B2C003B2FB9 /* OtherHandlers */,
|
D29DF27021E79B2C003B2FB9 /* OtherHandlers */,
|
||||||
D29DF13A21E68682003B2FB9 /* Utility */,
|
D29DF13A21E68682003B2FB9 /* Utility */,
|
||||||
@ -724,6 +745,7 @@
|
|||||||
D29DF26E21E6AA0B003B2FB9 /* FLAnimatedImage.h in Headers */,
|
D29DF26E21E6AA0B003B2FB9 /* FLAnimatedImage.h in Headers */,
|
||||||
D29DF11621E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.h in Headers */,
|
D29DF11621E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.h in Headers */,
|
||||||
D29DF17721E69E1F003B2FB9 /* MFTextButton.h in Headers */,
|
D29DF17721E69E1F003B2FB9 /* MFTextButton.h in Headers */,
|
||||||
|
01E569D3223FFFA500327251 /* ThreeLayerViewController.swift in Headers */,
|
||||||
D29DF16221E69996003B2FB9 /* MFViewController.h in Headers */,
|
D29DF16221E69996003B2FB9 /* MFViewController.h in Headers */,
|
||||||
D29DF13121E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.h in Headers */,
|
D29DF13121E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.h in Headers */,
|
||||||
D29DF2C421E7BF57003B2FB9 /* MFTabBarSwipeAnimator.h in Headers */,
|
D29DF2C421E7BF57003B2FB9 /* MFTabBarSwipeAnimator.h in Headers */,
|
||||||
@ -863,6 +885,7 @@
|
|||||||
D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */,
|
D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */,
|
||||||
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */,
|
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */,
|
||||||
D282AACB2243C61700C46919 /* ButtonView.swift in Sources */,
|
D282AACB2243C61700C46919 /* ButtonView.swift in Sources */,
|
||||||
|
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */,
|
||||||
D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */,
|
D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */,
|
||||||
D29DF18121E69E50003B2FB9 /* MFView.m in Sources */,
|
D29DF18121E69E50003B2FB9 /* MFView.m in Sources */,
|
||||||
D29DF18321E69E54003B2FB9 /* SeparatorView.m in Sources */,
|
D29DF18321E69E54003B2FB9 /* SeparatorView.m in Sources */,
|
||||||
@ -883,6 +906,7 @@
|
|||||||
D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */,
|
D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */,
|
||||||
D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */,
|
D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */,
|
||||||
D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */,
|
D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */,
|
||||||
|
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */,
|
||||||
D29DF29821E7ADB8003B2FB9 /* MFScrollingViewController.m in Sources */,
|
D29DF29821E7ADB8003B2FB9 /* MFScrollingViewController.m in Sources */,
|
||||||
D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */,
|
D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */,
|
||||||
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */,
|
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */,
|
||||||
@ -895,11 +919,13 @@
|
|||||||
DBC4391B224421A0001AB423 /* CaretButton.swift in Sources */,
|
DBC4391B224421A0001AB423 /* CaretButton.swift in Sources */,
|
||||||
D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */,
|
D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */,
|
||||||
D29DF29C21E7ADB9003B2FB9 /* MFProgrammaticTableViewController.m in Sources */,
|
D29DF29C21E7ADB9003B2FB9 /* MFProgrammaticTableViewController.m in Sources */,
|
||||||
|
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */,
|
||||||
D29DF2BE21E7BEA4003B2FB9 /* TopTabbar.m in Sources */,
|
D29DF2BE21E7BEA4003B2FB9 /* TopTabbar.m in Sources */,
|
||||||
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */,
|
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */,
|
||||||
D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */,
|
D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */,
|
||||||
D29DF29E21E7AE3B003B2FB9 /* MFStyler.m in Sources */,
|
D29DF29E21E7AE3B003B2FB9 /* MFStyler.m in Sources */,
|
||||||
D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */,
|
D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */,
|
||||||
|
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */,
|
||||||
D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */,
|
D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */,
|
||||||
D29DF2CB21E7BFCC003B2FB9 /* MFSizeThreshold.m in Sources */,
|
D29DF2CB21E7BFCC003B2FB9 /* MFSizeThreshold.m in Sources */,
|
||||||
D29770F521F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsViewController.m in Sources */,
|
D29770F521F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsViewController.m in Sources */,
|
||||||
|
|||||||
@ -12,24 +12,24 @@
|
|||||||
#import "MVMCoreUISplitViewController.h"
|
#import "MVMCoreUISplitViewController.h"
|
||||||
#import "MFStyler.h"
|
#import "MFStyler.h"
|
||||||
#import "UIColor+MFConvenience.h"
|
#import "UIColor+MFConvenience.h"
|
||||||
|
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||||
@import MVMCore.MVMCoreDispatchUtility;
|
@import MVMCore.MVMCoreDispatchUtility;
|
||||||
@import MVMCore.MVMCoreGetterUtility;
|
@import MVMCore.MVMCoreGetterUtility;
|
||||||
@import MVMCore.NSDictionary_MFConvenience;
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
|
|
||||||
@interface PrimaryButton ()
|
@interface PrimaryButton() <FormValidationProtocol>
|
||||||
|
|
||||||
|
|
||||||
|
@property (nonatomic) BOOL validationRequired;
|
||||||
@property (nonatomic) BOOL smallButton;
|
@property (nonatomic) BOOL smallButton;
|
||||||
@property (assign, nonatomic) BOOL tinyButton;
|
@property (assign, nonatomic) BOOL tinyButton;
|
||||||
|
@property (nonatomic) CGFloat sizeForSizing;
|
||||||
|
|
||||||
@property (weak, nonatomic) NSLayoutConstraint *height;
|
@property (weak, nonatomic) NSLayoutConstraint *height;
|
||||||
@property (weak, nonatomic) NSLayoutConstraint *width;
|
@property (weak, nonatomic) NSLayoutConstraint *width;
|
||||||
|
|
||||||
@property (strong, nonatomic) NSArray <MFTextField *>*textFields;
|
@property (strong, nonatomic) NSMutableArray <MFTextField *>*textFields;
|
||||||
|
|
||||||
@property (nonatomic, readwrite, assign) PrimaryButtonType primaryButtonType;
|
@property (nonatomic, readwrite, assign) PrimaryButtonType primaryButtonType;
|
||||||
|
|
||||||
@property (nonatomic) CGFloat sizeForSizing;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation PrimaryButton
|
@implementation PrimaryButton
|
||||||
@ -645,6 +645,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setWithJSON:(NSDictionary *)json delegate:(NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData {
|
- (void)setWithJSON:(NSDictionary *)json delegate:(NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData {
|
||||||
|
|
||||||
|
[FormValidator setupValidationWithMolecule:self delegate:(id<FormValidationProtocol>)delegate];
|
||||||
|
|
||||||
self.primaryButtonType = PrimaryButtonTypeCustom;
|
self.primaryButtonType = PrimaryButtonTypeCustom;
|
||||||
NSString *color = [json string:@"fillColor"];
|
NSString *color = [json string:@"fillColor"];
|
||||||
if (color) {
|
if (color) {
|
||||||
@ -666,6 +669,8 @@
|
|||||||
if ((color = [json string:@"disabledBorderColor"])) {
|
if ((color = [json string:@"disabledBorderColor"])) {
|
||||||
self.disabledBorderColor = [UIColor mfGetColorForHex:color];
|
self.disabledBorderColor = [UIColor mfGetColorForHex:color];
|
||||||
}
|
}
|
||||||
|
self.validationRequired = [json boolForKey:@"validationRequired"];
|
||||||
|
|
||||||
[self setAsSmallButton:[json boolForKey:@"small"]];
|
[self setAsSmallButton:[json boolForKey:@"small"]];
|
||||||
[self setWithActionMap:json actionDelegate:([delegate conformsToProtocol:@protocol(MVMCoreActionDelegateProtocol)] ? (NSObject <MVMCoreActionDelegateProtocol>*)delegate : nil) additionalData:additionalData buttonDelegate:([delegate conformsToProtocol:@protocol(ButtonDelegateProtocol)] ? (id <ButtonDelegateProtocol>)delegate : nil)];
|
[self setWithActionMap:json actionDelegate:([delegate conformsToProtocol:@protocol(MVMCoreActionDelegateProtocol)] ? (NSObject <MVMCoreActionDelegateProtocol>*)delegate : nil) additionalData:additionalData buttonDelegate:([delegate conformsToProtocol:@protocol(ButtonDelegateProtocol)] ? (id <ButtonDelegateProtocol>)delegate : nil)];
|
||||||
}
|
}
|
||||||
@ -673,6 +678,7 @@
|
|||||||
#pragma mark - Handling Validations
|
#pragma mark - Handling Validations
|
||||||
|
|
||||||
- (void)setEnabledByValidity {
|
- (void)setEnabledByValidity {
|
||||||
|
|
||||||
__block BOOL valid = YES;
|
__block BOOL valid = YES;
|
||||||
[self.textFields enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[self.textFields enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if (!((MFTextField *)obj).valid) {
|
if (!((MFTextField *)obj).valid) {
|
||||||
@ -680,7 +686,7 @@
|
|||||||
*stop = YES;
|
*stop = YES;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
self.enabled = valid && (self.extraValidationBlock ? self.extraValidationBlock() : YES);
|
self.enabled = valid && (self.extraValidationBlock ? self.extraValidationBlock() : YES);
|
||||||
}];
|
}];
|
||||||
@ -692,7 +698,7 @@
|
|||||||
field.mfTextFieldDelegate = nil;
|
field.mfTextFieldDelegate = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.textFields = textFields;
|
self.textFields = [textFields mutableCopy];
|
||||||
|
|
||||||
for (MFTextField *field in self.textFields) {
|
for (MFTextField *field in self.textFields) {
|
||||||
field.mfTextFieldDelegate = self;
|
field.mfTextFieldDelegate = self;
|
||||||
@ -708,7 +714,7 @@
|
|||||||
field.mfTextFieldDelegate = nil;
|
field.mfTextFieldDelegate = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.textFields = textFields;
|
self.textFields = [textFields mutableCopy];
|
||||||
|
|
||||||
for (MFTextField *field in self.textFields) {
|
for (MFTextField *field in self.textFields) {
|
||||||
field.mfTextFieldDelegate = self;
|
field.mfTextFieldDelegate = self;
|
||||||
@ -733,4 +739,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - FormValidationProtocol
|
||||||
|
|
||||||
|
- (void)enableField:(BOOL)enable {
|
||||||
|
if (!self.validationRequired) {
|
||||||
|
self.enabled = YES;
|
||||||
|
} else {
|
||||||
|
self.enabled = enable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MFTextField : MFView
|
@interface MFTextField : MFView <MVMCoreUIMoleculeViewProtocol>
|
||||||
|
|
||||||
@property (nullable, weak, nonatomic) UIView *view;
|
@property (nullable, weak, nonatomic) UIView *view;
|
||||||
|
|
||||||
@ -127,4 +127,8 @@
|
|||||||
|
|
||||||
- (void)setAccessibilityString:(nullable NSString *)accessibilityString;
|
- (void)setAccessibilityString:(nullable NSString *)accessibilityString;
|
||||||
|
|
||||||
|
// For Validator Protocol
|
||||||
|
- (nullable NSString *)formFieldName;
|
||||||
|
- (nullable id)formFieldValue;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -15,17 +15,26 @@
|
|||||||
#import "MFLabel.h"
|
#import "MFLabel.h"
|
||||||
#import "MVMCoreUIUtility.h"
|
#import "MVMCoreUIUtility.h"
|
||||||
#import "MVMCoreUIConstants.h"
|
#import "MVMCoreUIConstants.h"
|
||||||
|
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||||
@import MVMCore.MVMCoreDispatchUtility;
|
@import MVMCore.MVMCoreDispatchUtility;
|
||||||
@import MVMCore.NSDictionary_MFConvenience;
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
@import MVMCore.MVMCoreJSONConstants;
|
@import MVMCore.MVMCoreJSONConstants;
|
||||||
|
|
||||||
@interface MFTextField()
|
@interface MFTextField() <FormValidationProtocol>
|
||||||
|
|
||||||
@property (strong, nonatomic) UIColor *customPlaceHolderColor;
|
@property (strong, nonatomic) UIColor *customPlaceHolderColor;
|
||||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *separatorHeightConstraint;
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *separatorHeightConstraint;
|
||||||
@property (strong, nonatomic) UIBezierPath *borderPath;
|
@property (strong, nonatomic) UIBezierPath *borderPath;
|
||||||
@property (strong, nonatomic) NSCalendar *calendar;
|
@property (strong, nonatomic) NSCalendar *calendar;
|
||||||
|
|
||||||
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *textContainerLeftPin;
|
||||||
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *errorLableLeftPin;
|
||||||
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *formLabelLeftPin;
|
||||||
|
|
||||||
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *textContainerRightPin;
|
||||||
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *errorLableRightPin;
|
||||||
|
@property (nonatomic) BOOL isMolecule;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MFTextField
|
@implementation MFTextField
|
||||||
@ -38,6 +47,12 @@
|
|||||||
self.label.font = [MFStyler fontForTextFieldUnderLabel];
|
self.label.font = [MFStyler fontForTextFieldUnderLabel];
|
||||||
[MFStyler styleTextField:self.textField];
|
[MFStyler styleTextField:self.textField];
|
||||||
[self.dashLine updateView:size];
|
[self.dashLine updateView:size];
|
||||||
|
|
||||||
|
if (self.isMolecule) {
|
||||||
|
[self setHorizontalPadding:[MFStyler defaultHorizontalPaddingForSize:size]];
|
||||||
|
} else {
|
||||||
|
[self setHorizontalPadding:0];
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,10 +68,7 @@
|
|||||||
view.frame = self.frame;
|
view.frame = self.frame;
|
||||||
[self addSubview:view];
|
[self addSubview:view];
|
||||||
|
|
||||||
// self.textFieldContainerView.layer.borderWidth = 1;
|
|
||||||
// self.textFieldContainerView.layer.borderColor = [UIColor mfSilver].CGColor;
|
|
||||||
self.textField.font = [MFStyler fontForTextField];
|
self.textField.font = [MFStyler fontForTextField];
|
||||||
|
|
||||||
self.translatesAutoresizingMaskIntoConstraints = NO;
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
|
||||||
self.formLabel.font = [MFStyler fontB3];
|
self.formLabel.font = [MFStyler fontB3];
|
||||||
@ -104,37 +116,7 @@
|
|||||||
+ (nullable instancetype)mfTextFieldWithMap:(nullable NSDictionary *)map bothDelegates:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate {
|
+ (nullable instancetype)mfTextFieldWithMap:(nullable NSDictionary *)map bothDelegates:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate {
|
||||||
MFTextField *textField = [self mfTextField];
|
MFTextField *textField = [self mfTextField];
|
||||||
textField.translatesAutoresizingMaskIntoConstraints = NO;
|
textField.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
[textField setWithMap:map bothDelegates:delegate];
|
[textField setWithJSON:map delegate:delegate additionalData:nil];
|
||||||
if (map.count > 0) {
|
|
||||||
|
|
||||||
// Can add these to the set with map function later after verifying
|
|
||||||
NSString *string = [map string:@"fieldKey"];
|
|
||||||
if (string.length > 0) {
|
|
||||||
textField.fieldKey = string;
|
|
||||||
}
|
|
||||||
|
|
||||||
string = [map string:KeyType];
|
|
||||||
if ([string isEqualToString:@"dropDown"]) {
|
|
||||||
[[textField dropDownCarrotLabel] setHidden:NO];
|
|
||||||
[textField setHasDropDown:YES];
|
|
||||||
} else if ([string isEqualToString:@"password"]) {
|
|
||||||
textField.textField.secureTextEntry = YES;
|
|
||||||
} else if ([string isEqualToString:@"number"]) {
|
|
||||||
textField.textField.keyboardType = UIKeyboardTypeNumberPad;
|
|
||||||
} else if ([string isEqualToString:@"email"]) {
|
|
||||||
textField.textField.keyboardType = UIKeyboardTypeEmailAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
string = [map string:@"regex"];
|
|
||||||
if (string.length > 0) {
|
|
||||||
textField.validationBlock = ^BOOL(NSString * _Nullable enteredValue) {
|
|
||||||
return [MVMCoreUIUtility validateString:enteredValue withRegularExpression:string];
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
[textField setDefaultValidationBlock];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return textField;
|
return textField;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,25 +301,55 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setWithMap:(nullable NSDictionary *)map bothDelegates:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate {
|
- (void)setWithMap:(nullable NSDictionary *)map bothDelegates:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate {
|
||||||
if (map.count > 0) {
|
if (map.count == 0) {
|
||||||
NSString *string = [map string:KeyLabel];
|
return;
|
||||||
if (string.length > 0) {
|
}
|
||||||
self.formText = string;
|
|
||||||
}
|
[MVMCoreUICommonViewsUtility addDismissToolbar:self.textField delegate:delegate];
|
||||||
string = [map string:KeyValue];
|
[self setBothTextFieldDelegates:delegate];
|
||||||
if (string.length > 0) {
|
|
||||||
self.text = string;
|
NSString *string = [map string:KeyLabel];
|
||||||
}
|
if (string.length > 0) {
|
||||||
string = [map stringForKey:KeyDisable];
|
self.formText = string;
|
||||||
if ([string isEqual:StringY] || [map boolForKey:KeyDisable]) {
|
}
|
||||||
[self enable:NO];
|
string = [map string:KeyValue];
|
||||||
}
|
if (string.length > 0) {
|
||||||
string = [map string:KeyErrorMessage];
|
self.text = string;
|
||||||
if (string.length > 0) {
|
}
|
||||||
self.errMessage = string;
|
string = [map stringForKey:KeyDisable];
|
||||||
}
|
if ([string isEqual:StringY] || [map boolForKey:KeyDisable]) {
|
||||||
[MVMCoreUICommonViewsUtility addDismissToolbar:self.textField delegate:delegate];
|
[self enable:NO];
|
||||||
[self setBothTextFieldDelegates:delegate];
|
}
|
||||||
|
string = [map string:KeyErrorMessage];
|
||||||
|
if (string.length > 0) {
|
||||||
|
self.errMessage = string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// key used to send text value to server
|
||||||
|
string = [map string:@"fieldKey"];
|
||||||
|
if (string.length > 0) {
|
||||||
|
self.fieldKey = string;
|
||||||
|
}
|
||||||
|
|
||||||
|
string = [map string:KeyType];
|
||||||
|
if ([string isEqualToString:@"dropDown"]) {
|
||||||
|
[[self dropDownCarrotLabel] setHidden:NO];
|
||||||
|
[self setHasDropDown:YES];
|
||||||
|
} else if ([string isEqualToString:@"password"]) {
|
||||||
|
self.textField.secureTextEntry = YES;
|
||||||
|
} else if ([string isEqualToString:@"number"]) {
|
||||||
|
self.textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
|
} else if ([string isEqualToString:@"email"]) {
|
||||||
|
self.textField.keyboardType = UIKeyboardTypeEmailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
string = [map string:@"regex"];
|
||||||
|
if (string.length) {
|
||||||
|
self.validationBlock = ^BOOL(NSString * _Nullable enteredValue) {
|
||||||
|
return [MVMCoreUIUtility validateString:enteredValue withRegularExpression:string];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
[self setDefaultValidationBlock];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,6 +368,16 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setHorizontalPadding:(CGFloat)padding {
|
||||||
|
self.textContainerLeftPin.constant = padding;
|
||||||
|
self.errorLableLeftPin.constant = padding;
|
||||||
|
self.formLabelLeftPin.constant = padding;
|
||||||
|
|
||||||
|
self.textContainerRightPin.constant = padding;
|
||||||
|
self.errorLableRightPin.constant = padding;
|
||||||
|
self.formLabelRightPin.constant = padding;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[self setBothTextFieldDelegates:nil];
|
[self setBothTextFieldDelegates:nil];
|
||||||
}
|
}
|
||||||
@ -530,4 +552,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
||||||
|
|
||||||
|
- (void)setAsMolecule {
|
||||||
|
self.isMolecule = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setWithJSON:(NSDictionary *)json delegate:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate additionalData:(NSDictionary *)additionalData {
|
||||||
|
[FormValidator setupValidationWithMolecule:self delegate:(id<FormValidationProtocol>)delegate];
|
||||||
|
FormValidator *formValidator = [FormValidator getFormValidatorForDelegate:(id<FormValidationProtocol>)delegate];
|
||||||
|
[self setWithMap:json bothDelegates:formValidator];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - FormValidationProtocol
|
||||||
|
|
||||||
|
|
||||||
|
- (BOOL)isValidField {
|
||||||
|
return self.valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (nullable NSString *)formFieldName {
|
||||||
|
return self.fieldKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (nullable id)formFieldValue {
|
||||||
|
return self.text;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -14,11 +14,16 @@
|
|||||||
<outlet property="dashLine" destination="hw1-Eo-Szn" id="WCs-FF-LCg"/>
|
<outlet property="dashLine" destination="hw1-Eo-Szn" id="WCs-FF-LCg"/>
|
||||||
<outlet property="dropDownCarrotLabel" destination="XuL-hz-X9C" id="Kv1-Pd-Kra"/>
|
<outlet property="dropDownCarrotLabel" destination="XuL-hz-X9C" id="Kv1-Pd-Kra"/>
|
||||||
<outlet property="dropDownCarrotWidth" destination="DJA-00-1ne" id="SHb-1H-EZD"/>
|
<outlet property="dropDownCarrotWidth" destination="DJA-00-1ne" id="SHb-1H-EZD"/>
|
||||||
|
<outlet property="errorLableLeftPin" destination="8pf-sH-2Ct" id="nhS-H8-RKZ"/>
|
||||||
|
<outlet property="errorLableRightPin" destination="I5y-Go-vVq" id="TN8-Bi-GEP"/>
|
||||||
<outlet property="formLabel" destination="8zH-YN-qag" id="him-Et-eoN"/>
|
<outlet property="formLabel" destination="8zH-YN-qag" id="him-Et-eoN"/>
|
||||||
|
<outlet property="formLabelLeftPin" destination="gLb-br-rma" id="K1a-jV-qMg"/>
|
||||||
<outlet property="formLabelRightPin" destination="Gkx-Zw-C4C" id="7Nl-BF-Jjo"/>
|
<outlet property="formLabelRightPin" destination="Gkx-Zw-C4C" id="7Nl-BF-Jjo"/>
|
||||||
<outlet property="label" destination="2KH-5l-kKu" id="bld-nC-XdN"/>
|
<outlet property="label" destination="2KH-5l-kKu" id="bld-nC-XdN"/>
|
||||||
<outlet property="separatorHeightConstraint" destination="f1r-3b-nqr" id="Zzz-yD-9zP"/>
|
<outlet property="separatorHeightConstraint" destination="f1r-3b-nqr" id="Zzz-yD-9zP"/>
|
||||||
<outlet property="separatorView" destination="TDi-WU-Tyf" id="5zT-hU-Myw"/>
|
<outlet property="separatorView" destination="TDi-WU-Tyf" id="5zT-hU-Myw"/>
|
||||||
|
<outlet property="textContainerLeftPin" destination="sUf-uc-1Ta" id="k9f-nH-EO3"/>
|
||||||
|
<outlet property="textContainerRightPin" destination="BkX-rc-bYe" id="wKx-IQ-50w"/>
|
||||||
<outlet property="textField" destination="fQx-7g-t8O" id="FKe-6f-DxN"/>
|
<outlet property="textField" destination="fQx-7g-t8O" id="FKe-6f-DxN"/>
|
||||||
<outlet property="textFieldContainerView" destination="vFx-S6-fbH" id="85j-fY-e2P"/>
|
<outlet property="textFieldContainerView" destination="vFx-S6-fbH" id="85j-fY-e2P"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
|||||||
@ -27,59 +27,37 @@
|
|||||||
- (BOOL)hasText;
|
- (BOOL)hasText;
|
||||||
|
|
||||||
#pragma mark - 2.0
|
#pragma mark - 2.0
|
||||||
|
//75Bd 40pt
|
||||||
+ (nonnull MFLabel *)commonLabelB2:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelH1:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelH1:(BOOL)scale;
|
||||||
|
//75Bd 25pt
|
||||||
+ (nonnull MFLabel *)commonLabelH2:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelH2:(BOOL)scale;
|
||||||
|
//75Bd 18pt
|
||||||
+ (nonnull MFLabel *)commonLabelH3:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelH3:(BOOL)scale;
|
||||||
|
//75Bd 32pt
|
||||||
|
+ (nonnull MFLabel *)commonLabelH32:(BOOL)scale;
|
||||||
|
//75Bd 13pt
|
||||||
+ (nonnull MFLabel *)commonLabelB1:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelB1:(BOOL)scale;
|
||||||
|
//55Rg 13pt
|
||||||
|
+ (nonnull MFLabel *)commonLabelB2:(BOOL)scale;
|
||||||
|
//55Rg 11pt gray
|
||||||
+ (nonnull MFLabel *)commonLabelB3:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelB3:(BOOL)scale;
|
||||||
+ (nonnull MFLabel *)commonLabelFeedMessage:(BOOL)scale;
|
//55Rg 20pt
|
||||||
+ (nonnull MFLabel *)commonLabelFeedSubMessage:(BOOL)scale;
|
+ (nonnull MFLabel *)commonLabelB20:(BOOL)scale;
|
||||||
|
|
||||||
#pragma mark - 1.0
|
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
+ (nonnull MFLabel *)label NS_SWIFT_NAME(commonLabel());
|
+ (nonnull MFLabel *)label NS_SWIFT_NAME(commonLabel());
|
||||||
+ (nonnull MFLabel *)commonLabelBodyWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyBold:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyLighter:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyLarge:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineSmall:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineBlackWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelSubheadBold:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelSubheadBoldLarge:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedHeadline:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedTitle:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelPlanCardTitle:(BOOL)scale;
|
|
||||||
+ (nonnull MFLabel *)commonLabelTopAlert:(BOOL)scale;
|
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
+ (void)setLabel:(nullable UILabel *)label withHTML:(nullable NSString *)html;
|
+ (void)setLabel:(nullable UILabel *)label withHTML:(nullable NSString *)html;
|
||||||
+ (void)setUILabel:(nullable UILabel *)label withJSON:(nullable NSDictionary *)json delegate:(nullable NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData;
|
+ (void)setUILabel:(nullable UILabel *)label withJSON:(nullable NSDictionary *)json delegate:(nullable NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData;
|
||||||
- (void)styleB2:(BOOL)scale;
|
|
||||||
- (void)styleBodyWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
- (void)styleBodyBold:(BOOL)scale;
|
|
||||||
- (void)styleBodyLighter:(BOOL)scale;
|
|
||||||
- (void)styleBodyLarge:(BOOL)scale;
|
|
||||||
- (void)styleH1:(BOOL)scale;
|
- (void)styleH1:(BOOL)scale;
|
||||||
- (void)styleH2:(BOOL)scale;
|
- (void)styleH2:(BOOL)scale;
|
||||||
- (void)styleHeadlineLarge:(BOOL)scale;
|
|
||||||
- (void)styleHeadlineSmall:(BOOL)scale;
|
|
||||||
- (void)styleHeadlineWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
- (void)styleHeadlineBlackWithSize:(CGFloat)size scale:(BOOL)scale;
|
|
||||||
- (void)styleH3:(BOOL)scale;
|
- (void)styleH3:(BOOL)scale;
|
||||||
- (void)styleSubheadBold:(BOOL)scale;
|
- (void)styleH32:(BOOL)scale;
|
||||||
- (void)styleSubheadBoldLarge:(BOOL)scale;
|
|
||||||
- (void)styleB3:(BOOL)scale;
|
|
||||||
- (void)styleFeedHeadline:(BOOL)scale;
|
|
||||||
- (void)styleFeedTitle:(BOOL)scale;
|
|
||||||
- (void)stylePlanCardTitle:(BOOL)scale;
|
|
||||||
- (void)styleB1:(BOOL)scale;
|
- (void)styleB1:(BOOL)scale;
|
||||||
- (void)styleTableRow:(BOOL)scale;
|
- (void)styleB2:(BOOL)scale;
|
||||||
|
- (void)styleB3:(BOOL)scale;
|
||||||
// Without color
|
- (void)styleB20:(BOOL)scale;
|
||||||
- (void)setFontH1:(BOOL)scale;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -100,45 +100,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Getters
|
|
||||||
|
|
||||||
- (BOOL)hasText {
|
- (BOOL)hasText {
|
||||||
return self.text.length > 0 || self.attributedText.length > 0;
|
return self.text.length > 0 || self.attributedText.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull MFLabel *)label {
|
#pragma mark - 2.0
|
||||||
return [[MFLabel alloc] initWithFrame:CGRectZero];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelB2:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleB2:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleBodyWithSize:size scale:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyBold:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleBodyBold:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyLighter:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleBodyLighter:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelBodyLarge:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleBodyLarge:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelH1:(BOOL)scale {
|
+ (nonnull MFLabel *)commonLabelH1:(BOOL)scale {
|
||||||
MFLabel *label = [MFLabel label];
|
MFLabel *label = [MFLabel label];
|
||||||
@ -152,75 +118,14 @@
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineSmall:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleHeadlineSmall:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleHeadlineWithSize:size scale:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelHeadlineBlackWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleHeadlineBlackWithSize:size scale:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelH3:(BOOL)scale {
|
+ (nonnull MFLabel *)commonLabelH3:(BOOL)scale {
|
||||||
MFLabel *label = [MFLabel label];
|
MFLabel *label = [MFLabel label];
|
||||||
[label styleH3:scale];
|
[label styleH3:scale];
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
+ (nonnull MFLabel *)commonLabelH32:(BOOL)scale {
|
||||||
+ (nonnull MFLabel *)commonLabelSubheadBold:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
MFLabel *label = [MFLabel label];
|
||||||
[label styleSubheadBold:scale];
|
[label styleH32:scale];
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelSubheadBoldLarge:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleSubheadBoldLarge:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelB3:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleB3:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedMessage:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleFeedMessage:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedSubMessage:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleFeedSubMessage:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedHeadline:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleFeedHeadline:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelFeedTitle:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label styleFeedTitle:scale];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelPlanCardTitle:(BOOL)scale {
|
|
||||||
MFLabel *label = [MFLabel label];
|
|
||||||
[label stylePlanCardTitle:scale];
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,12 +135,28 @@
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull MFLabel *)commonLabelTopAlert:(BOOL)scale {
|
+ (nonnull MFLabel *)commonLabelB2:(BOOL)scale {
|
||||||
MFLabel *label = [MFLabel label];
|
MFLabel *label = [MFLabel label];
|
||||||
[label styleTopAlert:scale];
|
[label styleB2:scale];
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nonnull MFLabel *)commonLabelB3:(BOOL)scale {
|
||||||
|
MFLabel *label = [MFLabel label];
|
||||||
|
[label styleB3:scale];
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nonnull MFLabel *)commonLabelB20:(BOOL)scale {
|
||||||
|
MFLabel *label = [MFLabel label];
|
||||||
|
[label styleB20:scale];
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nonnull MFLabel *)label {
|
||||||
|
return [[MFLabel alloc] initWithFrame:CGRectZero];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Setters
|
#pragma mark - Setters
|
||||||
|
|
||||||
+ (void)setLabel:(nullable UILabel *)label withHTML:(nullable NSString *)html {
|
+ (void)setLabel:(nullable UILabel *)label withHTML:(nullable NSString *)html {
|
||||||
@ -316,31 +237,6 @@
|
|||||||
self.originalAttributedString = self.attributedText;
|
self.originalAttributedString = self.attributedText;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)styleB2:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelB2:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleBodyWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelB2:self size:size genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleBodyBold:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelBodyBold:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleBodyLighter:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelBodyLighter:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleBodyLarge:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelBodyLarge:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleH1:(BOOL)scale {
|
- (void)styleH1:(BOOL)scale {
|
||||||
[MFStyler styleLabelH1:self genericScaling:NO];
|
[MFStyler styleLabelH1:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
@ -351,68 +247,13 @@
|
|||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)styleHeadlineLarge:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelHeadlineLarge:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
- (void)styleHeadlineSmall:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelHeadlineSmall:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleHeadlineWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelH2:self size:size genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleHeadlineBlackWithSize:(CGFloat)size scale:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelHeadlineBlack:self size:size genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleH3:(BOOL)scale {
|
- (void)styleH3:(BOOL)scale {
|
||||||
[MFStyler styleLabelH3:self genericScaling:NO];
|
[MFStyler styleLabelH3:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)styleSubheadBold:(BOOL)scale {
|
- (void)styleH32:(BOOL)scale {
|
||||||
[MFStyler styleLabelSubheadBold:self genericScaling:NO];
|
[MFStyler styleLabelH32:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (void)styleSubheadBoldLarge:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelSubheadBoldLarge:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleB3:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelB3:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleFeedMessage:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelFeedMessage:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleFeedSubMessage:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelFeedSubMessage:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleFeedHeadline:(BOOL)scale {
|
|
||||||
[MFStyler styleLabelHeadlineFeed:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)styleFeedTitle:(BOOL)scale {
|
|
||||||
[MFStyler styleFeedCardTitleLabel:self genericScaling:NO];
|
|
||||||
[self setScale:scale];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)stylePlanCardTitle:(BOOL)scale {
|
|
||||||
self.font = [MFStyler fontForPlanCardTitle:NO];
|
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,18 +262,18 @@
|
|||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)styleTableRow:(BOOL)scale {
|
- (void)styleB2:(BOOL)scale {
|
||||||
[MFStyler styleLabelB1:self genericScaling:NO];
|
[MFStyler styleLabelB2:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)styleTopAlert:(BOOL)scale {
|
- (void)styleB3:(BOOL)scale {
|
||||||
self.font = [MFStyler fontB1:NO];
|
[MFStyler styleLabelB3:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setFontH1:(BOOL)scale {
|
- (void)styleB20:(BOOL)scale {
|
||||||
self.font = [MFStyler fontH1:NO];
|
[MFStyler styleLabelB20:self genericScaling:NO];
|
||||||
[self setScale:scale];
|
[self setScale:scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,9 +36,10 @@
|
|||||||
#import "MVMCoreUILoggingHandler.h"
|
#import "MVMCoreUILoggingHandler.h"
|
||||||
#import "MVMCoreUITabBarPageControlViewController.h"
|
#import "MVMCoreUITabBarPageControlViewController.h"
|
||||||
#import "MVMCoreUINavigationController.h"
|
#import "MVMCoreUINavigationController.h"
|
||||||
|
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||||
@import MVMAnimationFramework;
|
@import MVMAnimationFramework;
|
||||||
|
|
||||||
@interface MFViewController ()
|
@interface MFViewController() <FormValidationProtocol>
|
||||||
|
|
||||||
// A flag for if this view controller is observing for cache updates or not.
|
// A flag for if this view controller is observing for cache updates or not.
|
||||||
@property (nonatomic) BOOL observingForResponseJSONUpdates;
|
@property (nonatomic) BOOL observingForResponseJSONUpdates;
|
||||||
@ -52,10 +53,19 @@
|
|||||||
// title view for navigation bar, used for custom navigation titles
|
// title view for navigation bar, used for custom navigation titles
|
||||||
@property (weak, nonatomic) UILabel *titleLabel;
|
@property (weak, nonatomic) UILabel *titleLabel;
|
||||||
|
|
||||||
|
@property (strong, nonatomic) FormValidator *formValidator;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MFViewController
|
@implementation MFViewController
|
||||||
|
|
||||||
|
- (FormValidator *)formValidatorModel {
|
||||||
|
if (self.formValidator == nil) {
|
||||||
|
self.formValidator = [FormValidator new];
|
||||||
|
}
|
||||||
|
return self.formValidator;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)dismiss {
|
- (void)dismiss {
|
||||||
if (self.presentingViewController) {
|
if (self.presentingViewController) {
|
||||||
[[MVMCoreNavigationHandler sharedNavigationHandler] dismissViewController:self animated:YES];
|
[[MVMCoreNavigationHandler sharedNavigationHandler] dismissViewController:self animated:YES];
|
||||||
@ -241,9 +251,8 @@
|
|||||||
if (page) {
|
if (page) {
|
||||||
self.loadObject.pageJSON = page;
|
self.loadObject.pageJSON = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self newDataBuildScreen];
|
[self updateUI];
|
||||||
self.needToUpdateUI = YES;
|
|
||||||
[self.view setNeedsLayout];
|
[self.view setNeedsLayout];
|
||||||
[self.view layoutIfNeeded];
|
[self.view layoutIfNeeded];
|
||||||
}];
|
}];
|
||||||
@ -400,11 +409,9 @@
|
|||||||
[self initialLoad];
|
[self initialLoad];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since we have new data, build stuff for the screen.
|
// Since we have new data, build stuff for the screen and update the ui once the screen is done laying out.
|
||||||
[self newDataBuildScreen];
|
[self updateUI];
|
||||||
|
|
||||||
// Update the UI after the view is loaded.
|
|
||||||
self.needToUpdateUI = YES;
|
|
||||||
self.needToupdateUIOnScreenSizeChanges = YES;
|
self.needToupdateUIOnScreenSizeChanges = YES;
|
||||||
|
|
||||||
if (UIAccessibilityIsVoiceOverRunning()) {
|
if (UIAccessibilityIsVoiceOverRunning()) {
|
||||||
@ -416,6 +423,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)updateUI {
|
||||||
|
[self newDataBuildScreen];
|
||||||
|
[self.formValidator enableByValidation];
|
||||||
|
self.needToUpdateUI = YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)didReceiveMemoryWarning {
|
- (void)didReceiveMemoryWarning {
|
||||||
[super didReceiveMemoryWarning];
|
[super didReceiveMemoryWarning];
|
||||||
// Dispose of any resources that can be recreated.
|
// Dispose of any resources that can be recreated.
|
||||||
@ -587,6 +600,7 @@
|
|||||||
[[MVMCoreUISession sharedGlobal].splitViewController.rightPanel willOpenWithActionInformation:actionInformation];
|
[[MVMCoreUISession sharedGlobal].splitViewController.rightPanel willOpenWithActionInformation:actionInformation];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self.formValidator addFormParamsWithRequestParameters:requestParameters];
|
||||||
requestParameters.parentPageType = [self.loadObject.pageJSON stringForKey:@"parentPageType"];
|
requestParameters.parentPageType = [self.loadObject.pageJSON stringForKey:@"parentPageType"];
|
||||||
|
|
||||||
[[MVMCoreLoadHandler sharedGlobal] loadRequest:requestParameters dataForPage:additionalData delegate:self];
|
[[MVMCoreLoadHandler sharedGlobal] loadRequest:requestParameters dataForPage:additionalData delegate:self];
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import MVMAnimationFramework
|
import MVMAnimationFramework
|
||||||
|
|
||||||
public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
open class ThreeLayerViewController: ProgrammaticScrollViewController {
|
||||||
|
|
||||||
// The three main views
|
// The three main views
|
||||||
var topView: UIView?
|
var topView: UIView?
|
||||||
@ -22,8 +22,8 @@ public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
|
|
||||||
private var safeAreaView: UIView?
|
private var safeAreaView: UIView?
|
||||||
private var heightConstraint: NSLayoutConstraint?
|
private var heightConstraint: NSLayoutConstraint?
|
||||||
|
|
||||||
public override func updateViews() {
|
open override func updateViews() {
|
||||||
super.updateViews()
|
super.updateViews()
|
||||||
let width = view.bounds.width
|
let width = view.bounds.width
|
||||||
if let topView = topView as? MVMCoreViewProtocol {
|
if let topView = topView as? MVMCoreViewProtocol {
|
||||||
@ -37,7 +37,7 @@ public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func updateViewConstraints() {
|
open override func updateViewConstraints() {
|
||||||
super.updateViewConstraints()
|
super.updateViewConstraints()
|
||||||
guard let scrollView = scrollView else {
|
guard let scrollView = scrollView else {
|
||||||
return
|
return
|
||||||
@ -50,7 +50,7 @@ public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func loadView() {
|
open override func loadView() {
|
||||||
super.loadView()
|
super.loadView()
|
||||||
// The height is used to keep the bottom view at the bottom.
|
// The height is used to keep the bottom view at the bottom.
|
||||||
if let contentView = contentView, let scrollView = scrollView {
|
if let contentView = contentView, let scrollView = scrollView {
|
||||||
@ -59,7 +59,7 @@ public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func newDataBuildScreen() {
|
open override func newDataBuildScreen() {
|
||||||
super.newDataBuildScreen()
|
super.newDataBuildScreen()
|
||||||
|
|
||||||
// Removes the views
|
// Removes the views
|
||||||
@ -78,27 +78,27 @@ public class ThreeLayerViewController: ProgrammaticScrollViewController {
|
|||||||
|
|
||||||
//MARK:-Functions to subclass
|
//MARK:-Functions to subclass
|
||||||
// Subclass for a top view.
|
// Subclass for a top view.
|
||||||
public func viewForTop() -> UIView? {
|
open func viewForTop() -> UIView? {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subclass for a middle view.
|
// Subclass for a middle view.
|
||||||
public func viewForMiddle() -> UIView? {
|
open func viewForMiddle() -> UIView? {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subclass for a bottom view.
|
// Subclass for a bottom view.
|
||||||
public func viewForBottom() -> UIView? {
|
open func viewForBottom() -> UIView? {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a value is set, the middle view is pinned this value below the top view, if not, space is left to fill.
|
// If a value is set, the middle view is pinned this value below the top view, if not, space is left to fill.
|
||||||
public func spaceBetweenTopAndMiddle() -> CGFloat? {
|
open func spaceBetweenTopAndMiddle() -> CGFloat? {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a value is set, the middle view is pinned this value above the bottom view, if not, space is left to fill.
|
// If a value is set, the middle view is pinned this value above the bottom view, if not, space is left to fill.
|
||||||
public func spaceBetweenMiddleAndBottom() -> CGFloat? {
|
open func spaceBetweenMiddleAndBottom() -> CGFloat? {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ extension ThreeLayerViewController {
|
|||||||
|
|
||||||
//MARK:-Animation
|
//MARK:-Animation
|
||||||
extension ThreeLayerViewController {
|
extension ThreeLayerViewController {
|
||||||
public override func setupIntroAnimations() {
|
open override func setupIntroAnimations() {
|
||||||
if let topView = topView, topView.subviews.count > 0 {
|
if let topView = topView, topView.subviews.count > 0 {
|
||||||
introAnimationManager?.addAnimation(animation: MVMAnimations.fadeUpAnimation(view: topView))
|
introAnimationManager?.addAnimation(animation: MVMAnimations.fadeUpAnimation(view: topView))
|
||||||
}
|
}
|
||||||
|
|||||||
27
MVMCoreUI/FormUIHelpers/FormValidationProtocol.swift
Normal file
27
MVMCoreUI/FormUIHelpers/FormValidationProtocol.swift
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// FormValidationProtocol.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Suresh, Kamlesh on 3/26/19.
|
||||||
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objc public protocol FormValidationProtocol: NSObjectProtocol {
|
||||||
|
|
||||||
|
// Getter method to get the FormValidator form the delegate (Mostly from the parent View Controller)
|
||||||
|
@objc optional func formValidatorModel() -> FormValidator?
|
||||||
|
|
||||||
|
// Used to check the validity of the field, to enable/disable the primary button.
|
||||||
|
@objc optional func isValidField() -> Bool
|
||||||
|
|
||||||
|
// Based on the isValidField(), the fields which needs to be enabled can call this method
|
||||||
|
@objc optional func enableField(_ enable: Bool)
|
||||||
|
|
||||||
|
// The Field name key value pair for sending to server
|
||||||
|
@objc optional func formFieldName() -> String?
|
||||||
|
|
||||||
|
// The Feild value key value paid for sending to server
|
||||||
|
@objc optional func formFieldValue() -> String?
|
||||||
|
}
|
||||||
31
MVMCoreUI/FormUIHelpers/FormValidator+FormParams.swift
Normal file
31
MVMCoreUI/FormUIHelpers/FormValidator+FormParams.swift
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// MVMCoreUIFormValidator+FormParams.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Suresh, Kamlesh on 3/21/19.
|
||||||
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objc public extension FormValidator {
|
||||||
|
@objc public func addFormParams(requestParameters: MVMCoreRequestParameters) {
|
||||||
|
requestParameters.add(self.getFormParams())
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc public func getFormParams() -> [String: Any] {
|
||||||
|
var extraParam: [String: Any] = [:]
|
||||||
|
MVMCoreDispatchUtility.performSyncBlock(onMainThread: {
|
||||||
|
for molecule in self.molecules {
|
||||||
|
if let formFieldName = molecule.formFieldName,
|
||||||
|
let formFieldValue = molecule.formFieldValue,
|
||||||
|
let fieldName = formFieldName(),
|
||||||
|
let fieldValue = formFieldValue() {
|
||||||
|
|
||||||
|
extraParam[fieldName] = fieldValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return extraParam
|
||||||
|
}
|
||||||
|
}
|
||||||
92
MVMCoreUI/FormUIHelpers/FormValidator+TextFields.swift
Normal file
92
MVMCoreUI/FormUIHelpers/FormValidator+TextFields.swift
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
//
|
||||||
|
// MVMCoreUIFormValidator+TextFields.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Suresh, Kamlesh on 3/21/19.
|
||||||
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objc extension FormValidator: UITextFieldDelegate {
|
||||||
|
public func textFieldDidEndEditing(_ textField: UITextField) {
|
||||||
|
enableByValidation()
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
delegate.textFieldDidEndEditing?(textField)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||||
|
textField.resignFirstResponder()
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
return delegate.textFieldShouldReturn?(textField) ?? true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
delegate.textFieldDidBeginEditing?(textField)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
return delegate.textFieldShouldBeginEditing?(textField) ?? true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
return delegate.textFieldShouldEndEditing?(textField) ?? true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
delegate.textFieldDidEndEditing?(textField, reason: reason)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
return delegate.textField?(textField, shouldChangeCharactersIn: range, replacementString: string) ?? true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
public func textFieldShouldClear(_ textField: UITextField) -> Bool {
|
||||||
|
if let delegate = delegate as? UITextFieldDelegate {
|
||||||
|
return delegate.textFieldShouldClear?(textField) ?? true
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc extension FormValidator: MFTextFieldDelegate {
|
||||||
|
public func dismissFieldInput(_ sender: Any?) {
|
||||||
|
if let delegate = delegate as? MFTextFieldDelegate {
|
||||||
|
delegate.dismissFieldInput?(sender)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func entryIsValid(_ textfield: MFTextField?) {
|
||||||
|
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||||
|
self.enableByValidation()
|
||||||
|
if let delegate = self.delegate as? MFTextFieldDelegate {
|
||||||
|
delegate.entryIsValid?(textfield)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
public func entryIsInvalid(_ textfield: MFTextField?) {
|
||||||
|
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||||
|
self.enableByValidation()
|
||||||
|
if let delegate = self.delegate as? MFTextFieldDelegate {
|
||||||
|
delegate.entryIsInvalid?(textfield)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
59
MVMCoreUI/FormUIHelpers/FormValidator.swift
Normal file
59
MVMCoreUI/FormUIHelpers/FormValidator.swift
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
//
|
||||||
|
// FormValidator.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Suresh, Kamlesh on 3/26/19.
|
||||||
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@objcMembers public class FormValidator: NSObject {
|
||||||
|
|
||||||
|
var delegate: FormValidationProtocol?
|
||||||
|
var molecules: [UIView & FormValidationProtocol] = []
|
||||||
|
var extraValidationBlock: (() -> Bool)?
|
||||||
|
|
||||||
|
public func insertMolecule(_ molecule: UIView & FormValidationProtocol) {
|
||||||
|
molecules.append(molecule)
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func getFormValidatorFor(delegate: FormValidationProtocol) -> FormValidator? {
|
||||||
|
if let delegateFormValidatorModel = delegate.formValidatorModel,
|
||||||
|
let validator = delegateFormValidatorModel() {
|
||||||
|
return validator
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func setupValidation(molecule: UIView & FormValidationProtocol, delegate: FormValidationProtocol?) {
|
||||||
|
if let delegateFormValidatorModel = delegate?.formValidatorModel,
|
||||||
|
let validator = delegateFormValidatorModel() {
|
||||||
|
|
||||||
|
validator.delegate = delegate
|
||||||
|
validator.insertMolecule(molecule)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func enableByValidation() {
|
||||||
|
var valid = true
|
||||||
|
for molecule in molecules {
|
||||||
|
if let isValidField = molecule.isValidField,
|
||||||
|
isValidField() == false {
|
||||||
|
valid = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let enableField = valid && (extraValidationBlock?() ?? true)
|
||||||
|
shouldEnable(enableField)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func shouldEnable(_ enable: Bool) {
|
||||||
|
for molecule in molecules {
|
||||||
|
if let enableField = molecule.enableField {
|
||||||
|
enableField(enable)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
import MVMCore
|
import MVMCore
|
||||||
|
|
||||||
|
|
||||||
public class MFTextFieldListView: MFView {
|
public class MFTextFieldListView: ViewConstrainingView {
|
||||||
|
|
||||||
public var textFieldMapList: [[String: Any]]?
|
public var textFieldMapList: [[String: Any]]?
|
||||||
public var parentViewContoller: MFViewController?
|
public var parentViewContoller: MFViewController?
|
||||||
@ -24,7 +24,7 @@ public class MFTextFieldListView: MFView {
|
|||||||
self.primaryButton = primaryButton
|
self.primaryButton = primaryButton
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
}
|
}
|
||||||
|
|
||||||
public required init?(coder decoder: NSCoder) {
|
public required init?(coder decoder: NSCoder) {
|
||||||
super.init(coder: decoder)
|
super.init(coder: decoder)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,17 +16,17 @@ public class MoleculeStackView: MFView {
|
|||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
init(withJSON json: [AnyHashable : Any]?, delegate: NSObject?, additionalData: [AnyHashable : Any]?) {
|
public init(withJSON json: [AnyHashable : Any]?, delegate: NSObject?, additionalData: [AnyHashable : Any]?) {
|
||||||
super.init(frame: CGRect.zero)
|
super.init(frame: CGRect.zero)
|
||||||
setWithJSON(json, delegate: delegate, additionalData: additionalData)
|
setWithJSON(json, delegate: delegate, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init(withJSON json: [AnyHashable : Any]?, delegate: NSObject?, spacingBlock: ((Any) -> UIEdgeInsets)?) {
|
public convenience init(withJSON json: [AnyHashable : Any]?, delegate: NSObject?, spacingBlock: ((Any) -> UIEdgeInsets)?) {
|
||||||
self.init(withJSON: json, delegate: delegate, additionalData: nil)
|
self.init(withJSON: json, delegate: delegate, additionalData: nil)
|
||||||
self.spacingBlock = spacingBlock
|
self.spacingBlock = spacingBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
public required init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@
|
|||||||
#pragma mark - Common styles
|
#pragma mark - Common styles
|
||||||
|
|
||||||
- (void)setAsLargeHeadline {
|
- (void)setAsLargeHeadline {
|
||||||
[MFStyler styleLabelHeadlineLarge:self.headlineLabel];
|
[MFStyler styleLabelH1:self.headlineLabel];
|
||||||
[self layoutIfNeeded];
|
[self layoutIfNeeded];
|
||||||
if (self.tableView) {
|
if (self.tableView) {
|
||||||
[self.tableView showHeader];
|
[self.tableView showHeader];
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
@import MVMCore.NSDictionary_MFConvenience;
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
#import "MVMCoreUIObject.h"
|
#import "MVMCoreUIObject.h"
|
||||||
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||||
|
#import "MFTextField.h"
|
||||||
|
|
||||||
@implementation MVMCoreUIMoleculeMappingObject
|
@implementation MVMCoreUIMoleculeMappingObject
|
||||||
|
|
||||||
@ -30,7 +31,8 @@
|
|||||||
@"twoButtonView": TwoButtonView.class,
|
@"twoButtonView": TwoButtonView.class,
|
||||||
@"standardFooter": StandardFooterView.class,
|
@"standardFooter": StandardFooterView.class,
|
||||||
@"caretView": CaretView.class,
|
@"caretView": CaretView.class,
|
||||||
@"caretButton": CaretButton.class
|
@"caretButton": CaretButton.class,
|
||||||
|
@"textField" : MFTextField.class
|
||||||
} mutableCopy];
|
} mutableCopy];
|
||||||
});
|
});
|
||||||
return mapping;
|
return mapping;
|
||||||
@ -59,8 +61,9 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
UIView <MVMCoreUIMoleculeViewProtocol>*molecule = [self getMoleculeForName:moleculeName];
|
UIView <MVMCoreUIMoleculeViewProtocol>*molecule = [self getMoleculeForName:moleculeName];
|
||||||
[molecule setWithJSON:json delegate:delegate additionalData:nil];
|
[molecule setWithJSON:json delegate:delegate additionalData:nil];
|
||||||
return molecule;
|
return molecule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -104,6 +104,9 @@ B3 -> Legal
|
|||||||
//75Bd 18pt
|
//75Bd 18pt
|
||||||
+ (nullable UIFont *)fontH3:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontH3:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontH3;
|
+ (nullable UIFont *)fontH3;
|
||||||
|
//75Bd 32pt
|
||||||
|
+ (nullable UIFont *)fontH32:(BOOL)genericScaling;
|
||||||
|
+ (nullable UIFont *)fontH32;
|
||||||
|
|
||||||
//75Bd 13pt
|
//75Bd 13pt
|
||||||
+ (nullable UIFont *)fontB1:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontB1:(BOOL)genericScaling;
|
||||||
@ -114,10 +117,9 @@ B3 -> Legal
|
|||||||
//55Rg 11pt
|
//55Rg 11pt
|
||||||
+ (nullable UIFont *)fontB3:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontB3:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontB3;
|
+ (nullable UIFont *)fontB3;
|
||||||
//55Rg 14pt
|
//55Rg 20pt
|
||||||
+ (nullable UIFont *)fontB4:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontB20:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontB4;
|
+ (nullable UIFont *)fontB20;
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - 1.0 fonts
|
#pragma mark - 1.0 fonts
|
||||||
|
|
||||||
@ -125,91 +127,48 @@ B3 -> Legal
|
|||||||
+ (nullable UIFont *)fontForPlan;
|
+ (nullable UIFont *)fontForPlan;
|
||||||
//75Bd 48pt
|
//75Bd 48pt
|
||||||
+ (nullable UIFont *)fontForBiggerHeadline;
|
+ (nullable UIFont *)fontForBiggerHeadline;
|
||||||
//75Bd 26pt
|
|
||||||
+ (nullable UIFont *)fontForLoyaltySignUpHeadLine;
|
|
||||||
//75Bd 40pt
|
|
||||||
+ (nullable UIFont *)fontForFeedHeadline;
|
|
||||||
//55Rg 20pt
|
|
||||||
+ (nullable UIFont *)fontForFeedMessage;
|
|
||||||
//55Rg 11pt
|
|
||||||
+ (nullable UIFont *)fontForFeedSubMessage;
|
|
||||||
//75Bd 15pt
|
//75Bd 15pt
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall;
|
+ (nullable UIFont *)fontForHeadlineSmall;
|
||||||
//75Bd 11pt
|
|
||||||
+ (nullable UIFont *)fontForHeadlineTiny;
|
|
||||||
//75Bd 16pt
|
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall2;
|
|
||||||
//75Bd 32pt
|
|
||||||
+ (nullable UIFont *)fontForHeadlineLarge;
|
|
||||||
//75Bd 36pt
|
|
||||||
+ (nullable UIFont *)fontForHeadlineExtraLarge;
|
|
||||||
//75Bd 14pt
|
|
||||||
+ (nullable UIFont *)fontForSubheadBold;
|
|
||||||
//75Md 20pt
|
|
||||||
+ (nullable UIFont *)fontForSubheadBoldLarge;
|
|
||||||
|
|
||||||
//55Rg 14pt
|
//55Rg 14pt
|
||||||
+ (nullable UIFont *)fontforChatText;
|
+ (nullable UIFont *)fontforChatText;
|
||||||
//55Rg 16pt
|
//55Rg 16pt
|
||||||
+ (nullable UIFont *)fontForAccountLandingGreeting;
|
+ (nullable UIFont *)fontForAccountLandingGreeting;
|
||||||
//55Rg 20pt
|
|
||||||
+ (nullable UIFont *)fontForBodyLarge;
|
|
||||||
//Bold System 13
|
|
||||||
+ (nullable UIFont *)fontForBodyBold;
|
|
||||||
|
|
||||||
//55Rg 10pt
|
//55Rg 10pt
|
||||||
+ (nullable UIFont *)fontForProgressBarBottomLabel;
|
+ (nullable UIFont *)fontForProgressBarBottomLabel;
|
||||||
//55Rg 14pt
|
//55Rg 14pt
|
||||||
+ (nullable UIFont *)fontForPrimaryButton;
|
+ (nullable UIFont *)fontForPrimaryButton;
|
||||||
//55Rg 12pt
|
//75Bd 11pt
|
||||||
+ (nullable UIFont *)fontForSmallButton;
|
+ (nullable UIFont *)fontForSmallButton;
|
||||||
//45Lt 20pt
|
//55Rg 16pt
|
||||||
+ (nullable UIFont *)fontForTextField;
|
+ (nullable UIFont *)fontForTextField;
|
||||||
//55Rg 12pt
|
//55Rg 12pt
|
||||||
+ (nullable UIFont *)fontForTextFieldUnderLabel;
|
+ (nullable UIFont *)fontForTextFieldUnderLabel;
|
||||||
//45Lt 24pt
|
//55Rg 24pt
|
||||||
+ (nullable UIFont *)fontForHeadlineAlternative;
|
+ (nullable UIFont *)fontForHeadlineAlternative;
|
||||||
//65Md 16pt
|
//75Bd 16pt
|
||||||
+ (nullable UIFont *)fontForFeedCardTitle;
|
+ (nullable UIFont *)fontForFeedCardTitle;
|
||||||
//65Md 18pt
|
|
||||||
+ (nullable UIFont *)fontForSupportQuestionMark;
|
|
||||||
//65Md 11pt
|
|
||||||
+ (nullable UIFont *)fontForSupportDateStamp;
|
|
||||||
//65Md 10pt
|
|
||||||
+ (nullable UIFont *)fontForProgressBarTopLabel;
|
|
||||||
//75Bd 20pt
|
|
||||||
+ (nullable UIFont *)fontForPlanCardTitle;
|
|
||||||
//75Bd 18pt
|
|
||||||
+ (nullable UIFont *)fontForAccesseriesHeadline;
|
|
||||||
//75Bd 60pt
|
//75Bd 60pt
|
||||||
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle;
|
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle;
|
||||||
//75Bd 42pt
|
//75Bd 42pt
|
||||||
+ (nullable UIFont *)fontForLoyaltyTitleSmall;
|
+ (nullable UIFont *)fontForLoyaltyTitleSmall;
|
||||||
//55Rg 20pt
|
//55Rg 20pt
|
||||||
+ (nullable UIFont *)fontForLoyaltyMessage;
|
+ (nullable UIFont *)fontForLoyaltyMessage;
|
||||||
//45Lt 24pt only for support
|
//75Bd 10pt only for support
|
||||||
+ (nullable UIFont *)fontForUnreadMessageOnSupport;
|
+ (nullable UIFont *)fontForUnreadMessageOnSupport;
|
||||||
|
|
||||||
// Returns the fonts for these styles allowing to apply a generic scale by device or not.
|
// Returns the fonts for these styles allowing to apply a generic scale by device or not.
|
||||||
+ (nullable UIFont *)fontForHeadlineWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForFeedHeadline:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForFeedMessage:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForFeedSubMessage:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling;
|
||||||
|
+ (nullable UIFont *)fontForHeadlineSmall2;
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall2:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForHeadlineSmall2:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall2ForWidth:(CGFloat)size;
|
+ (nullable UIFont *)fontForHeadlineSmall2ForWidth:(CGFloat)size;
|
||||||
+ (nullable UIFont *)fontForHeadlineLarge:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForHeadlineExtraLarge:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontB1ForWidth:(CGFloat)size;
|
+ (nullable UIFont *)fontB1ForWidth:(CGFloat)size;
|
||||||
+ (nullable UIFont *)fontForSubheadBold:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForSubheadBoldLarge:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontB2ForWidth:(CGFloat)size;
|
+ (nullable UIFont *)fontB2ForWidth:(CGFloat)size;
|
||||||
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size forWidth:(CGFloat)width;
|
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size forWidth:(CGFloat)width;
|
||||||
+ (nullable UIFont *)fontforChatText:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontforChatText:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForAccountLandingGreeting:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForAccountLandingGreeting:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForBodyLarge:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForBodyBold:(BOOL)genericScaling;
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForPrimaryButtonForWidth:(CGFloat)size;
|
+ (nullable UIFont *)fontForPrimaryButtonForWidth:(CGFloat)size;
|
||||||
@ -221,11 +180,6 @@ B3 -> Legal
|
|||||||
+ (nullable UIFont *)fontForHeadlineAlternativeForWidth:(CGFloat)size;
|
+ (nullable UIFont *)fontForHeadlineAlternativeForWidth:(CGFloat)size;
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedCardTitle:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForFeedCardTitle:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForSupportQuestionMark:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForSupportDateStamp:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForProgressBarTopLabel:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForPlanCardTitle:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForAccesseriesHeadline:(BOOL)genericScaling;
|
|
||||||
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForLoyaltyTitleSmall:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForLoyaltyTitleSmall:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForLoyaltyMessage:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForLoyaltyMessage:(BOOL)genericScaling;
|
||||||
@ -251,83 +205,52 @@ B3 -> Legal
|
|||||||
+ (void)styleLabelH3:(nonnull UILabel *)label;
|
+ (void)styleLabelH3:(nonnull UILabel *)label;
|
||||||
+ (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
|
|
||||||
|
+ (void)styleLabelH32:(nonnull UILabel *)label;
|
||||||
|
+ (void)styleLabelH32:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
|
|
||||||
+ (void)styleLabelB1:(nonnull UILabel *)label;
|
+ (void)styleLabelB1:(nonnull UILabel *)label;
|
||||||
+ (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
|
|
||||||
|
+ (void)styleLabelB2:(nonnull UILabel *)label;
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
||||||
|
|
||||||
+ (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleLabelB3:(nonnull UILabel *)label;
|
+ (void)styleLabelB3:(nonnull UILabel *)label;
|
||||||
|
|
||||||
+ (void)styleLabelB4:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelB20:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleLabelB4:(nonnull UILabel *)label;
|
+ (void)styleLabelB20:(nonnull UILabel *)label;
|
||||||
|
|
||||||
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label;
|
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label;
|
||||||
|
|
||||||
#pragma mark - 1.0 styles
|
#pragma mark - 1.0 styles
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineLarge:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelHeadlineFeed:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelFeedMessage:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelFeedSubMessage:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelSubheadBold:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelBodyLarge:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelBodyBold:(nonnull UILabel *)label;
|
|
||||||
+ (void)styleLabelBodyLighter:(nonnull UILabel *)label;
|
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label;
|
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label;
|
||||||
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label;
|
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label;
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleStandardSeparatorView:(nonnull UIView *)view;
|
+ (void)styleStandardSeparatorView:(nonnull UIView *)view;
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleLabelHeadlineLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelHeadlineFeed:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelFeedMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelFeedSubMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelH2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelHeadlineBlack:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelSubheadBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelSubheadBoldLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelBodyLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelBodyBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
+ (void)styleLabelBodyLighter:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
+ (void)styleFeedCardTagLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling;
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// Sets the text with strings attributed with these styles.
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithH2:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithHeadlineLarge:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithHeadlineExtraLarge:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithH3:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithB2:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithBodyBold:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
+ (void)styleSetLabelTextWithB3:(nonnull UILabel *)label text:(nullable NSString *)text;
|
|
||||||
|
|
||||||
#pragma mark - Attributed Strings
|
#pragma mark - Attributed Strings
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color;
|
+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color;
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetH1AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineLargeAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetH2AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineExtraLargeAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetH3AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetSubheadAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetB1AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetBodyAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetB2AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetBodyBoldAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetB3AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetDisabledBodyAttributedString:(nullable NSString *)string;
|
|
||||||
+ (nonnull NSAttributedString *)styleGetLegalAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetDisabledB2AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetSubtitleAttributedString:(nullable NSString *)string;
|
+ (nonnull NSAttributedString *)styleGetDisabledB1AttributedString:(nullable NSString *)string;
|
||||||
+ (nonnull NSAttributedString *)styleGetDisabledSubtitleAttributedString:(nullable NSString *)string;
|
|
||||||
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
|
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
|
||||||
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftStringRightTop:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
|
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftStringRightTop:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color;
|
||||||
+ (void)styleGetAlignCenteredAttrituedString:(nullable NSMutableAttributedString *)string;
|
+ (void)styleGetAlignCenteredAttrituedString:(nullable NSMutableAttributedString *)string;
|
||||||
@ -336,6 +259,7 @@ B3 -> Legal
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// Returns colors for Gradient Text presets
|
// Returns colors for Gradient Text presets
|
||||||
|
|
||||||
+ (nonnull NSArray *)gradientSpecialTicketGold;
|
+ (nonnull NSArray *)gradientSpecialTicketGold;
|
||||||
+ (nonnull NSArray *)gradientSpecialTicketGoldCGColor;
|
+ (nonnull NSArray *)gradientSpecialTicketGoldCGColor;
|
||||||
|
|
||||||
|
|||||||
@ -126,15 +126,68 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [self fontH3:YES];
|
return [self fontH3:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Fonts
|
+ (nullable UIFont *)fontH32:(BOOL)genericScaling {
|
||||||
|
CGFloat size = 32;
|
||||||
+ (nullable UIFont *)fontForHeadlineWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
}
|
}
|
||||||
return [MFFonts mfFont75Bd:size];
|
return [MFFonts mfFont75Bd:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontH32 {
|
||||||
|
return [self fontH32:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB1:(BOOL)genericScaling {
|
||||||
|
CGFloat size = 13;
|
||||||
|
if (genericScaling) {
|
||||||
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
|
}
|
||||||
|
return [MFFonts mfFont75Bd:size];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB1 {
|
||||||
|
return [self fontB1:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB2:(BOOL)genericScaling {
|
||||||
|
CGFloat size = 13;
|
||||||
|
if (genericScaling) {
|
||||||
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
|
}
|
||||||
|
return [MFFonts mfFont55Rg:size];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB2 {
|
||||||
|
return [self fontB2:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB3:(BOOL)genericScaling {
|
||||||
|
CGFloat size = 11;
|
||||||
|
if (genericScaling) {
|
||||||
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
|
}
|
||||||
|
return [MFFonts mfFont55Rg:size];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB3 {
|
||||||
|
return [self fontB3:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB20:(BOOL)genericScaling {
|
||||||
|
CGFloat size = 20;
|
||||||
|
if (genericScaling) {
|
||||||
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
|
}
|
||||||
|
return [MFFonts mfFont55Rg:size];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontB20 {
|
||||||
|
return [self fontB20:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - 1.0 Fonts
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling {
|
||||||
CGFloat size = 100;
|
CGFloat size = 100;
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
@ -143,6 +196,10 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont75Bd:size];
|
return [MFFonts mfFont75Bd:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)fontForPlan {
|
||||||
|
return [self fontForPlan:YES];
|
||||||
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling {
|
||||||
CGFloat size = 48;
|
CGFloat size = 48;
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
@ -151,36 +208,8 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont75Bd:size];
|
return [MFFonts mfFont75Bd:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForLoyaltySignUpHeadLine:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForBiggerHeadline {
|
||||||
CGFloat size = 26;
|
return [self fontForBiggerHeadLine:YES];
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedHeadline:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 32;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedMessage:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 20;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedSubMessage:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 11;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling {
|
||||||
@ -205,61 +234,12 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont75Bd:pointSize];
|
return [MFFonts mfFont75Bd:pointSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineLarge:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 40;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineExtraLarge:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 36;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)commonLabelB1:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 13;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB1ForWidth:(CGFloat)size {
|
+ (nullable UIFont *)fontB1ForWidth:(CGFloat)size {
|
||||||
CGFloat pointSize = 13;
|
CGFloat pointSize = 13;
|
||||||
pointSize = [[MFStyler sizeObjectGenericForCurrentDevice:pointSize] getValueBasedOnSize:size];
|
pointSize = [[MFStyler sizeObjectGenericForCurrentDevice:pointSize] getValueBasedOnSize:size];
|
||||||
return [MFFonts mfFont75Bd:pointSize];
|
return [MFFonts mfFont75Bd:pointSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSubheadBold:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 14;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSubheadBoldLarge:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 20;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB2:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 13;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
size = [self sizeFontGenericForCurrentDevice:size];
|
||||||
@ -294,30 +274,6 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont55Rg:size];
|
return [MFFonts mfFont55Rg:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBodyLarge:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 20;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBodyBold:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 13;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB3:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 11;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForProgressBarBottomLabel:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForProgressBarBottomLabel:(BOOL)genericScaling {
|
||||||
CGFloat size = 10;
|
CGFloat size = 10;
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
@ -326,14 +282,6 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont55Rg:size];
|
return [MFFonts mfFont55Rg:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB1:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 13;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling {
|
||||||
CGFloat size = 14;
|
CGFloat size = 14;
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
@ -416,54 +364,6 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont75Bd:size];
|
return [MFFonts mfFont75Bd:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB4:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 14;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont55Rg:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSupportQuestionMark:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 18;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSupportDateStamp:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 11;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForProgressBarTopLabel:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 10;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPlanCardTitle:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 20;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForAccesseriesHeadline:(BOOL)genericScaling {
|
|
||||||
CGFloat size = 18.0;
|
|
||||||
if (genericScaling) {
|
|
||||||
size = [self sizeFontGenericForCurrentDevice:size];
|
|
||||||
}
|
|
||||||
return [MFFonts mfFont75Bd:size];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling {
|
||||||
CGFloat size = 60;
|
CGFloat size = 60;
|
||||||
if (genericScaling) {
|
if (genericScaling) {
|
||||||
@ -510,62 +410,14 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFontOcratxt:size];
|
return [MFFonts mfFontOcratxt:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPlan {
|
|
||||||
return [self fontForPlan:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBiggerHeadline {
|
|
||||||
return [self fontForBiggerHeadLine:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForLoyaltySignUpHeadLine {
|
|
||||||
return [self fontForLoyaltySignUpHeadLine:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedHeadline {
|
|
||||||
return [self fontForFeedHeadline:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedMessage {
|
|
||||||
return [self fontForFeedMessage:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForFeedSubMessage {
|
|
||||||
return [self fontForFeedSubMessage:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall {
|
+ (nullable UIFont *)fontForHeadlineSmall {
|
||||||
return [self fontForHeadlineSmall:YES];
|
return [self fontForHeadlineSmall:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineTiny {
|
|
||||||
return [MFFonts mfFont75Bd:11];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineSmall2 {
|
+ (nullable UIFont *)fontForHeadlineSmall2 {
|
||||||
return [self fontForHeadlineSmall2:YES];
|
return [self fontForHeadlineSmall2:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineLarge {
|
|
||||||
return [self fontForHeadlineLarge:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineExtraLarge {
|
|
||||||
return [self fontForHeadlineExtraLarge:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSubheadBold {
|
|
||||||
return [self fontForSubheadBold:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSubheadBoldLarge {
|
|
||||||
return [self fontForSubheadBoldLarge:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB2 {
|
|
||||||
return [self fontB2:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontforChatText {
|
+ (nullable UIFont *)fontforChatText {
|
||||||
return [self fontforChatText:NO];
|
return [self fontforChatText:NO];
|
||||||
}
|
}
|
||||||
@ -574,26 +426,10 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [self fontForAccountLandingGreeting:YES];
|
return [self fontForAccountLandingGreeting:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBodyLarge {
|
|
||||||
return [self fontForBodyLarge:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForBodyBold {
|
|
||||||
return [self fontForBodyBold:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB3 {
|
|
||||||
return [self fontB3:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForProgressBarBottomLabel {
|
+ (nullable UIFont *)fontForProgressBarBottomLabel {
|
||||||
return [self fontForProgressBarBottomLabel:YES];
|
return [self fontForProgressBarBottomLabel:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB1 {
|
|
||||||
return [self fontB1:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPrimaryButton {
|
+ (nullable UIFont *)fontForPrimaryButton {
|
||||||
return [self fontForPrimaryButton:YES];
|
return [self fontForPrimaryButton:YES];
|
||||||
}
|
}
|
||||||
@ -618,30 +454,6 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [self fontForFeedCardTitle:YES];
|
return [self fontForFeedCardTitle:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable UIFont *)fontB4 {
|
|
||||||
return [self fontB4:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSupportQuestionMark {
|
|
||||||
return [self fontForSupportQuestionMark:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForSupportDateStamp {
|
|
||||||
return [self fontForSupportDateStamp:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForProgressBarTopLabel {
|
|
||||||
return [self fontForProgressBarTopLabel:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForPlanCardTitle {
|
|
||||||
return [self fontForPlanCardTitle:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForAccesseriesHeadline {
|
|
||||||
return [self fontForAccesseriesHeadline:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle {
|
+ (nullable UIFont *)fontForLargeLoyaltyHeaderTitle {
|
||||||
return [self fontForLargeLoyaltyHeaderTitle:YES];
|
return [self fontForLargeLoyaltyHeaderTitle:YES];
|
||||||
}
|
}
|
||||||
@ -686,29 +498,44 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
[self styleLabelH2:label genericScaling:YES];
|
[self styleLabelH2:label genericScaling:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelH3:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontH3];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontH3:genericScaling];
|
label.font = [MFStyler fontH3:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void)styleLabelH3:(nonnull UILabel *)label {
|
||||||
|
[self styleLabelH3:label genericScaling:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)styleLabelH32:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
|
label.font = [MFStyler fontH32:genericScaling];
|
||||||
|
label.textColor = [UIColor blackColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)styleLabelH32:(nonnull UILabel *)label {
|
||||||
|
[self styleLabelH32:label genericScaling:YES];
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontB1:genericScaling];
|
label.font = [MFStyler fontB1:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void)styleLabelB1:(nonnull UILabel *)label {
|
||||||
|
[self styleLabelB1:label genericScaling:YES];
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontB2:genericScaling];
|
label.font = [MFStyler fontB2:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void)styleLabelB2:(nonnull UILabel *)label {
|
||||||
|
[self styleLabelB2:label genericScaling:YES];
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontForBodyWithSize:size genericScaling:genericScaling];
|
label.font = [MFStyler fontForBodyWithSize:size genericScaling:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
@ -717,18 +544,16 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB3:(nonnull UILabel *)label {
|
+ (void)styleLabelB3:(nonnull UILabel *)label {
|
||||||
label.font = [MFStyler fontB3];
|
[self styleLabelB3:label genericScaling:YES];
|
||||||
label.textColor = [UIColor mfBattleshipGrey];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB4:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelB20:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontB4:genericScaling];
|
label.font = [MFStyler fontB20:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelB4:(nonnull UILabel *)label {
|
+ (void)styleLabelB20:(nonnull UILabel *)label {
|
||||||
label.font = [MFStyler fontB4];
|
[self styleLabelB20:label genericScaling:YES];
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
@ -737,67 +562,12 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label {
|
+ (void)styleLabelTextStyle2:(nonnull UILabel *)label {
|
||||||
label.font = [MFStyler fontB2];
|
[self styleLabelTextStyle2:label genericScaling:YES];
|
||||||
label.textColor = [UIColor mfBattleshipGrey];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelFeedMessage:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForFeedMessage];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelFeedSubMessage:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForFeedMessage];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - 1.0 Styles
|
#pragma mark - 1.0 Styles
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineLarge:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForHeadlineLarge];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForHeadlineExtraLarge];
|
|
||||||
label.textColor = [UIColor mfRedColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineFeed:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForFeedHeadline];
|
|
||||||
label.textColor = [UIColor mfRedColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelSubheadBold:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForSubheadBold];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelB2:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontB2];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyLarge:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForBodyLarge];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyBold:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontForBodyBold];
|
|
||||||
label.textColor = [UIColor mfCharcoalColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyLighter:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontB2];
|
|
||||||
label.textColor = [UIColor mfGrayColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelB1:(nonnull UILabel *)label {
|
|
||||||
label.font = [MFStyler fontB1];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label {
|
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label {
|
||||||
label.font = [MFStyler fontForFeedCardTitle];
|
label.font = [MFStyler fontForFeedCardTitle];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
@ -808,78 +578,15 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
label.textColor = [UIColor mfBrownishGrey];
|
label.textColor = [UIColor mfBrownishGrey];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleStandardSeparatorView:(nonnull UIView *)view {
|
+ (void)styleStandardSeparatorView:(nonnull UIView *)view {
|
||||||
[view setBackgroundColor:[UIColor mfBackgroundGray]];
|
[view setBackgroundColor:[UIColor mfBackgroundGray]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontForHeadlineSmall:genericScaling];
|
label.font = [MFStyler fontForHeadlineSmall:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForHeadlineLarge:genericScaling];
|
|
||||||
label.textColor = [UIColor mfRedColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForHeadlineExtraLarge:genericScaling];
|
|
||||||
label.textColor = [UIColor mfRedColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineFeed:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForFeedHeadline:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelFeedMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForFeedMessage:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelFeedSubMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForFeedSubMessage:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
+ (void)styleLabelH2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForHeadlineWithSize:size genericScaling:genericScaling];
|
|
||||||
label.textColor = [UIColor mfRedColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelHeadlineBlack:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForHeadlineWithSize:size genericScaling:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleLabelSubheadBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForSubheadBold:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelSubheadBoldLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForSubheadBoldLarge:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForBodyLarge:genericScaling];
|
|
||||||
label.textColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontForBodyBold:genericScaling];
|
|
||||||
label.textColor = [UIColor mfCharcoalColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleLabelBodyLighter:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
|
||||||
label.font = [MFStyler fontB2:genericScaling];
|
|
||||||
label.textColor = [UIColor mfGrayColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
+ (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling {
|
||||||
label.font = [MFStyler fontForFeedCardTitle:genericScaling];
|
label.font = [MFStyler fontForFeedCardTitle:genericScaling];
|
||||||
label.textColor = [UIColor blackColor];
|
label.textColor = [UIColor blackColor];
|
||||||
@ -890,42 +597,6 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
label.textColor = [UIColor mfBrownishGrey];
|
label.textColor = [UIColor mfBrownishGrey];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Set Text With Styles
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithH2:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelH2:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithHeadlineLarge:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelHeadlineLarge:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
+ (void)styleSetLabelTextWithHeadlineExtraLarge:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelHeadlineExtraLarge:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithH3:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelH3:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithB2:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelB2:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithBodyBold:(UILabel *)label text:(NSString *)text {
|
|
||||||
[MFStyler styleLabelBodyBold:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)styleSetLabelTextWithB3:(nonnull UILabel *)label text:(nullable NSString *)text {
|
|
||||||
[MFStyler styleLabelB3:label];
|
|
||||||
label.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Attributed Strings
|
#pragma mark - Attributed Strings
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color {
|
+ (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color {
|
||||||
@ -942,46 +613,38 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return attributedString;
|
return attributedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineAttributedString:(nullable NSString *)string {
|
+ (nonnull NSAttributedString *)styleGetH1AttributedString:(nullable NSString *)string {
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontH2] color:[UIColor mfRedColor]];
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontH1] color:[UIColor blackColor]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineLargeAttributedString:(nullable NSString *)string {
|
+ (nonnull NSAttributedString *)styleGetH2AttributedString:(nullable NSString *)string {
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontForHeadlineLarge] color:[UIColor mfRedColor]];
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontH2] color:[UIColor blackColor]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetHeadlineExtraLargeAttributedString:(nullable NSString *)string {
|
+ (nonnull NSAttributedString *)styleGetH3AttributedString:(nullable NSString *)string {
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontForHeadlineExtraLarge] color:[UIColor mfRedColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetSubheadAttributedString:(nullable NSString *)string {
|
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontH3] color:[UIColor blackColor]];
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontH3] color:[UIColor blackColor]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetBodyAttributedString:(nullable NSString *)string {
|
+ (nonnull NSAttributedString *)styleGetB1AttributedString:(nullable NSString *)string {
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB2] color:[UIColor blackColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetDisabledBodyAttributedString:(nullable NSString *)string {
|
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB2] color:[UIColor mfLighterGrayColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetBodyBoldAttributedString:(nullable NSString *)string {
|
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontForBodyBold] color:[UIColor mfCharcoalColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetLegalAttributedString:(nullable NSString *)string {
|
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB3] color:[UIColor mfGrayColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetSubtitleAttributedString:(nullable NSString *)string {
|
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB1] color:[UIColor blackColor]];
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB1] color:[UIColor blackColor]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetDisabledSubtitleAttributedString:(nullable NSString *)string {
|
+ (nonnull NSAttributedString *)styleGetB2AttributedString:(nullable NSString *)string {
|
||||||
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB2] color:[UIColor blackColor]];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nonnull NSAttributedString *)styleGetB3AttributedString:(nullable NSString *)string {
|
||||||
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB3] color:[UIColor mfBattleshipGrey]];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nonnull NSAttributedString *)styleGetDisabledB1AttributedString:(nullable NSString *)string {
|
||||||
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB1] color:[UIColor mfLighterGrayColor]];
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB1] color:[UIColor mfLighterGrayColor]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nonnull NSAttributedString *)styleGetDisabledB2AttributedString:(nullable NSString *)string {
|
||||||
|
return [MFStyler styleGetAttributedString:string font:[MFStyler fontB2] color:[UIColor mfLighterGrayColor]];
|
||||||
|
}
|
||||||
|
|
||||||
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color {
|
+ (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color {
|
||||||
if (left == nil){
|
if (left == nil){
|
||||||
left = @"";
|
left = @"";
|
||||||
|
|||||||
@ -17,14 +17,16 @@ public class MoleculeStackCenteredTemplate: ThreeLayerViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func viewForTop() -> UIView? {
|
public override func viewForTop() -> UIView? {
|
||||||
guard let moleculeJSON = loadObject?.pageJSON?.optionalDictionaryForKey("header"), let molecule = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeForJSON(moleculeJSON, delegate: self) else {
|
guard let moleculeJSON = loadObject?.pageJSON?.optionalDictionaryForKey("header"),
|
||||||
|
let molecule = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeForJSON(moleculeJSON, delegate: self) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return molecule
|
return molecule
|
||||||
}
|
}
|
||||||
|
|
||||||
override public func viewForBottom() -> UIView? {
|
override public func viewForBottom() -> UIView? {
|
||||||
guard let moleculeJSON = loadObject?.pageJSON?.optionalDictionaryForKey("footer"), let molecule = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeForJSON(moleculeJSON, delegate: self) else {
|
guard let moleculeJSON = loadObject?.pageJSON?.optionalDictionaryForKey("footer"),
|
||||||
|
let molecule = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeForJSON(moleculeJSON, delegate: self) else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return molecule
|
return molecule
|
||||||
|
|||||||
@ -20,25 +20,18 @@
|
|||||||
|
|
||||||
#pragma mark - 2.0 labels
|
#pragma mark - 2.0 labels
|
||||||
|
|
||||||
|
+ (nonnull UILabel *)commonLabelH1;
|
||||||
+ (nonnull UILabel *)commonLabelH2;
|
+ (nonnull UILabel *)commonLabelH2;
|
||||||
+ (nonnull UILabel *)commonLabelH3;
|
+ (nonnull UILabel *)commonLabelH3;
|
||||||
|
+ (nonnull UILabel *)commonLabelH32;
|
||||||
+ (nonnull UILabel *)commonLabelB1;
|
+ (nonnull UILabel *)commonLabelB1;
|
||||||
+ (nonnull UILabel *)commonLabelB2;
|
+ (nonnull UILabel *)commonLabelB2;
|
||||||
+ (nonnull UILabel *)commonLabelB3;
|
+ (nonnull UILabel *)commonLabelB3;
|
||||||
+ (nonnull UILabel *)commonLabelB4;
|
|
||||||
|
|
||||||
#pragma mark - Labels
|
#pragma mark - Labels
|
||||||
|
|
||||||
// Creates and returns common labels
|
// Creates and returns common labels
|
||||||
+ (nonnull UILabel *)label;
|
+ (nonnull UILabel *)label;
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineLarge;
|
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineExtraLarge;
|
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineFeed;
|
|
||||||
+ (nonnull UILabel *)commonLabelSubheadBold;
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyBold;
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyLarge;
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyLighter;
|
|
||||||
+ (nonnull UILabel *)commonLabelFeedTitle;
|
|
||||||
|
|
||||||
#pragma mark - Text Field
|
#pragma mark - Text Field
|
||||||
|
|
||||||
|
|||||||
@ -53,21 +53,9 @@ static const CGFloat VertialShadowOffset = 6;
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineLarge {
|
+ (nonnull UILabel *)commonLabelH1 {
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
||||||
[MFStyler styleLabelHeadlineLarge:label];
|
[MFStyler styleLabelH1:label];
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineExtraLarge {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelHeadlineExtraLarge:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelHeadlineFeed {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelHeadlineFeed:label];
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,39 +71,9 @@ static const CGFloat VertialShadowOffset = 6;
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelSubheadBold {
|
+ (nonnull UILabel *)commonLabelH32 {
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
||||||
[MFStyler styleLabelSubheadBold:label];
|
[MFStyler styleLabelH32:label];
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelBody {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelB2:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyBold {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelBodyBold:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyLarge {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelBodyLarge:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelBodyLighter {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelBodyLighter:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelFeedTitle {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleFeedCardTitleLabel:label];
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,12 +95,6 @@ static const CGFloat VertialShadowOffset = 6;
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UILabel *)commonLabelB4 {
|
|
||||||
UILabel *label = [MVMCoreUICommonViewsUtility label];
|
|
||||||
[MFStyler styleLabelB4:label];
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Text Field
|
#pragma mark - Text Field
|
||||||
|
|
||||||
+ (nonnull UIPickerView *)addPickerToTextField:(nonnull UITextField *)textField delegate:(nullable id <UITextFieldDelegate,UIPickerViewDelegate,UIPickerViewDataSource>)delegate {
|
+ (nonnull UIPickerView *)addPickerToTextField:(nonnull UITextField *)textField delegate:(nullable id <UITextFieldDelegate,UIPickerViewDelegate,UIPickerViewDataSource>)delegate {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user