Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into bugfix/category_collision

This commit is contained in:
Pfeil, Scott Robert 2020-03-05 09:56:51 -05:00
commit b027333a46
13 changed files with 226 additions and 62 deletions

View File

@ -106,6 +106,8 @@
52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */; };
5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */; };
5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; };
525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */; };
525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DC2406430800EED91C /* ListProgressBarData.swift */; };
525019E52406852100EED91C /* ListFourColumnDataUsageDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */; };
525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; };
52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; };
@ -451,6 +453,8 @@
52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinks.swift; sourceTree = "<group>"; };
5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDivider.swift; sourceTree = "<group>"; };
5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = "<group>"; };
525019DB2406430700EED91C /* ListProgressBarDataModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarDataModel.swift; sourceTree = "<group>"; };
525019DC2406430800EED91C /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = "<group>"; };
525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDividerModel.swift; sourceTree = "<group>"; };
525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDivider.swift; sourceTree = "<group>"; };
52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethod.swift; sourceTree = "<group>"; };
@ -813,6 +817,15 @@
path = OneColumn;
sourceTree = "<group>";
};
525239C32407FFCC00454969 /* LockUps */ = {
isa = PBXGroup;
children = (
525019DB2406430700EED91C /* ListProgressBarDataModel.swift */,
525019DC2406430800EED91C /* ListProgressBarData.swift */,
);
path = LockUps;
sourceTree = "<group>";
};
525019E3240684E500EED91C /* FourColumn */ = {
isa = PBXGroup;
children = (
@ -1028,6 +1041,7 @@
D22B38E923F4E07800490EF6 /* DesignedComponents */ = {
isa = PBXGroup;
children = (
525239C32407FFCC00454969 /* LockUps */,
D22B38EC23F4E10700490EF6 /* SectionDividers */,
D22B38EA23F4E08B00490EF6 /* List */,
);
@ -1780,6 +1794,7 @@
D213347723843825008E41B3 /* Line.swift in Sources */,
D28A837723C79FC600DFE4FC /* MFCustomButton+ActionModel.swift in Sources */,
D2E2A99C23D8D975000B42E6 /* ImageHeadlineBodyModel.swift in Sources */,
525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */,
D28A837F23CCA96400DFE4FC /* TabsModel.swift in Sources */,
012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */,
D2A514672213885800345BFB /* MoleculeHeaderView.swift in Sources */,
@ -1948,6 +1963,7 @@
D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */,
94C661D923CCF4B400D9FE5B /* LeftRightLabelModel.swift in Sources */,
D21EE53C23AD3AD4003D1A30 /* NSLayoutConstraintAxis+Extension.swift in Sources */,
525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */,
C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */,
01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */,
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */,

View File

@ -10,48 +10,48 @@ import Foundation
public extension NSLayoutConstraint {
/// Pins the views vertically in the super view, allowing the super to expand depending on the tallest view. Shorter views are aligned center.
static func pinViewsVerticalExpandableAlignCenter(_ views: [UIView]) {
/// Pins the views vertically to the top and bottom anchor, allowing the super to expand depending on the tallest view. Shorter views are aligned center.
static func pinViewsVerticalExpandableAlignCenter(_ views: [UIView], topAnchor: NSLayoutYAxisAnchor? = nil, bottomAnchor: NSLayoutYAxisAnchor? = nil, constant: CGFloat = 0) {
for view in views {
guard let superView = view.superview else {
return
}
guard let superView = view.superview else { return }
let top = topAnchor ?? superView.layoutMarginsGuide.topAnchor
let bottom = bottomAnchor ?? superView.layoutMarginsGuide.bottomAnchor
view.centerYAnchor.constraint(equalTo: superView.centerYAnchor).isActive = true
view.topAnchor.constraint(greaterThanOrEqualTo: superView.layoutMarginsGuide.topAnchor).isActive = true
superView.layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: view.bottomAnchor).isActive = true
view.topAnchor.constraint(greaterThanOrEqualTo: top).isActive = true
bottom.constraint(greaterThanOrEqualTo: view.bottomAnchor).isActive = true
var constraint = view.topAnchor.constraint(equalTo: superView.layoutMarginsGuide.topAnchor)
var constraint = view.topAnchor.constraint(equalTo: top)
constraint.priority = .defaultLow
constraint.isActive = true
constraint = superView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: view.bottomAnchor)
constraint = bottom.constraint(equalTo: view.bottomAnchor)
constraint.priority = .defaultLow
constraint.isActive = true
}
}
/// Pins the views vertically in the super view, allowing the super to expand depending on the tallest view. Shorter views are aligned top.
static func pinViewsVerticalExpandableAlignTop(_ views: [UIView]) {
/// Pins the views vertically to the top and bottom anchor, allowing the super to expand depending on the tallest view. Shorter views are aligned top.
static func pinViewsVerticalExpandableAlignTop(_ views: [UIView], topAnchor: NSLayoutYAxisAnchor? = nil, bottomAnchor: NSLayoutYAxisAnchor? = nil, constant: CGFloat = 0) {
for view in views {
guard let superView = view.superview else {
return
}
view.topAnchor.constraint(equalTo: superView.layoutMarginsGuide.topAnchor).isActive = true
superView.layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: view.bottomAnchor).isActive = true
guard let superView = view.superview else { return }
let top = topAnchor ?? superView.layoutMarginsGuide.topAnchor
let bottom = bottomAnchor ?? superView.layoutMarginsGuide.bottomAnchor
view.topAnchor.constraint(equalTo: top).isActive = true
bottom.constraint(greaterThanOrEqualTo: view.bottomAnchor, constant: constant).isActive = true
let constraint = superView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: view.bottomAnchor)
let constraint = bottom.constraint(equalTo: view.bottomAnchor)
constraint.priority = .defaultLow
constraint.isActive = true
}
}
/// Pins a view to the left and a view to the right, flexible space in between. The super can expand depending on the taller view. Shorter views are aligned top if alignTop true, else aligned center.
static func pinViews(leftView: UIView, rightView: UIView, alignTop: Bool) {
static func pinViews(leftView: UIView, rightView: UIView, alignTop: Bool, topAnchor: NSLayoutYAxisAnchor? = nil, bottomAnchor: NSLayoutYAxisAnchor? = nil, constant: CGFloat = 0) {
guard let superView = leftView.superview else { return }
if alignTop {
pinViewsVerticalExpandableAlignTop([leftView, rightView])
pinViewsVerticalExpandableAlignTop([leftView, rightView], topAnchor: topAnchor, bottomAnchor: bottomAnchor, constant: constant)
} else {
pinViewsVerticalExpandableAlignCenter([leftView, rightView])
pinViewsVerticalExpandableAlignCenter([leftView, rightView], topAnchor: topAnchor, bottomAnchor: bottomAnchor, constant: constant)
}
leftView.leadingAnchor.constraint(equalTo: superView.layoutMarginsGuide.leadingAnchor).isActive = true
superView.layoutMarginsGuide.trailingAnchor.constraint(equalTo: rightView.trailingAnchor).isActive = true

View File

@ -50,11 +50,14 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
// Convenience getter
+ (nullable instancetype)mainSplitViewController;
/// Initializes the splitviewcontroller with the passed in panels.
- (nullable instancetype)initWithLeftPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel;
// Returns a split controller with the mvm styling. Also sets the appropriate handlers.
+ (nullable instancetype)setup;
+ (nullable instancetype)setup:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel;
// Returns a split controller with the mvm styling. Also sets the appropriate handlers. Also sets up the default load screen
+ (nullable instancetype)setupAsMainController;
+ (nullable instancetype)setupAsMainController:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel;
#pragma mark - Panel Functions
@ -83,9 +86,6 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
// contains speicaly logic to set the icon color
- (void)setNavigationIconColor:(nullable UIColor *)color;
///create right and left panel. if left and right panel is already created, will replace them
- (void)createPanels;
/// Updates the panels that are used.
- (void)setupPanels;
@ -123,10 +123,6 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
// Can subclass to set threshold for when the drawers are permanently extended. Default is 1000 for the left panel and 2000 for both.
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(nullable NSNumber *)forWidth;
// subclass to return default global panels. kept alive after creation.
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createLeftPanelViewController;
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createRightPanelViewController;
// subclass to change image of back button
- (nullable UIImage *)imageForBackButton;

View File

@ -76,18 +76,26 @@ CGFloat const PanelAnimationDuration = 0.2;
return [MVMCoreActionUtility initializerClassCheck:[MVMCoreUISession sharedGlobal].splitViewController classToVerify:self];
}
+ (nullable instancetype)setup {
MVMCoreUISplitViewController *splitViewController = [[self alloc] init];
+ (nullable instancetype)setup:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel {
MVMCoreUISplitViewController *splitViewController = [[self alloc] initWithLeftPanel:leftPanel rightPanel:rightPanel];
[MVMCoreUISession sharedGlobal].splitViewController = splitViewController;
return splitViewController;
}
+ (nullable instancetype)setupAsMainController {
MVMCoreUISplitViewController *splitViewController = [self setup];
+ (nullable instancetype)setupAsMainController:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel {
MVMCoreUISplitViewController *splitViewController = [self setup:leftPanel rightPanel:rightPanel];
[[MVMCoreUISession sharedGlobal] setupAsStandardLoadViewDelegate:splitViewController];
return splitViewController;
}
- (nullable instancetype)initWithLeftPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)leftPanel rightPanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)rightPanel {
if (self = [super init]) {
self.globalLeftPanel = leftPanel;
self.globalRightPanel = rightPanel;
}
return self;
}
#pragma mark - Main Subclassables
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth {
@ -100,14 +108,6 @@ CGFloat const PanelAnimationDuration = 0.2;
return (width > 2000 ? MFTwoDrawer : (width > 1000 ? MFOneDrawer : MFNoDrawer));
}
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createLeftPanelViewController {
return nil;
}
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createRightPanelViewController {
return nil;
}
- (nullable NSArray <UIBarButtonItem *>*)additionalLeftButtons {
return nil;
}
@ -766,13 +766,6 @@ CGFloat const PanelAnimationDuration = 0.2;
}
}
- (void)createPanels {
// Create panels
self.globalLeftPanel = [self createLeftPanelViewController];
self.globalRightPanel = [self createRightPanelViewController];
[self setupPanels];
}
- (void)setupPanels {
[self forceHideBothDrawers];
[self setupLeftPanel];
@ -869,7 +862,7 @@ CGFloat const PanelAnimationDuration = 0.2;
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
[self createPanels];
[self setupPanels];
}
- (void)viewDidLoad {

View File

@ -23,6 +23,7 @@
@property (nullable, weak, nonatomic) UIView *containerView;
@property (nullable, weak, nonatomic) UIView *indicatorRectangle;
@property (nullable, copy, nonatomic) PagingTouchBlock pagingTouchBlock;
@property (nullable, strong, nonatomic) UITapGestureRecognizer *tapGestureRecognizer;
///set YES to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is NO
@property (nonatomic) BOOL isSlidesAcc;

View File

@ -267,6 +267,7 @@ static CGFloat const IndicatorRectangleHeight = 4;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] init];
[tapGesture addTarget:self action:@selector(rectangleTapped:)];
[self addGestureRecognizer:tapGesture];
self.tapGestureRecognizer = tapGesture;
}
}

View File

@ -9,32 +9,48 @@
import Foundation
open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open class var identifier: String {
return "listLVCB"
}
public var checkbox: CheckboxModel
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(checkbox: CheckboxModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
self.checkbox = checkbox
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
super.init()
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case eyebrowHeadlineBodyLink
case checkbox
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
checkbox = try typeContainer.decodeIfPresent(CheckboxModel.self, forKey: .checkbox) ?? CheckboxModel()
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
open override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)

View File

@ -0,0 +1,73 @@
//
// ListProgressBarData.swift
// MVMCoreUI
//
// Created by Kruthika KP on 18/02/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import UIKit
@objcMembers open class ListProgressBarData: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
let progressBar = MultiProgress(frame: .zero)
let leftLabel = Label.createLabelBoldBodySmall(true)
let rightLabel = Label.createLabelBoldBodySmall(true)
let view = MVMCoreUICommonViewsUtility.commonView()
//-----------------------------------------------------
// MARK: - MFViewProtocol
//-----------------------------------------------------
override open func setupView() {
super.setupView()
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
view.addSubview(progressBar)
view.addSubview(leftLabel)
view.addSubview(rightLabel)
contentView.addSubview(view)
containerHelper.constrainView(view)
NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: true, bottomAnchor: progressBar.topAnchor, constant: 8)
progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
view.bottomAnchor.constraint(equalTo: progressBar.bottomAnchor).isActive = true
}
public override func updateView(_ size: CGFloat) {
super.updateView(size)
progressBar.updateView(size)
leftLabel.updateView(size)
rightLabel.updateView(size)
}
//-----------------------------------------------------
// MARK: - ModelMoleculeViewProtocol
//-----------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListProgressBarDataModel else { return}
progressBar.set(with: model.progressBar, delegateObject, additionalData)
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 90
}
//-----------------------------------------------------
// MARK: - MVMCoreUIMoleculeViewProtocol
//-----------------------------------------------------
override open func reset() {
super.reset()
progressBar.reset()
leftLabel.reset()
rightLabel.reset()
leftLabel.styleBoldBodySmall(true)
rightLabel.styleBoldBodySmall(true)
}
}

View File

@ -0,0 +1,47 @@
//
// ListProgressBarDataModel.swift
// MVMCoreUI
//
// Created by Kruthika KP on 18/02/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol {
public static var identifier: String = "listPrgBarData"
public var progressBar : MultiProgressBarModel
public var leftLabel: LabelModel
public var rightLabel: LabelModel
public init (progressBar: MultiProgressBarModel, leftLabel: LabelModel, rightLabel: LabelModel){
self.progressBar = progressBar
self.leftLabel = leftLabel
self.rightLabel = rightLabel
super.init()
}
private enum CodingKeys: String, CodingKey{
case moleculeName
case progressBar
case leftLabel
case rightLabel
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
progressBar = try typeContainer.decode(MultiProgressBarModel.self, forKey: .progressBar)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(progressBar, forKey: .progressBar)
try container.encode(leftLabel, forKey: .leftLabel)
try container.encode(rightLabel, forKey: .rightLabel)
}
}

View File

@ -38,7 +38,7 @@ import Foundation
stack.restack()
}
// MARK: - MVMCoreUIMoleculeViewProtocol
// MARK: - ModelMoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListFourColumnDataUsageDividerModel else { return }
@ -48,6 +48,10 @@ import Foundation
label4.set(with: model.label4, delegateObject, additionalData)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 121
}
// MARK: - MVMCoreUIMoleculeViewProtocol
open override func reset() {
super.reset()
@ -56,8 +60,4 @@ import Foundation
label3.styleBoldBodySmall(true)
label4.styleBoldBodySmall(true)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 121
}
}

View File

@ -35,7 +35,7 @@ import Foundation
stack.restack()
}
// MARK: - MVMCoreUIMoleculeViewProtocol
// MARK: - ModelMoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnPlanDataDividerModel else { return }

View File

@ -10,12 +10,20 @@
import Foundation
@objcMembers open class ListItemModel: ContainerModel, ListItemModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public var backgroundColor: Color?
public var action: ActionModelProtocol?
public var hideArrow: Bool?
public var line: LineModel?
public var style: String?
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case backgroundColor
case action
@ -24,6 +32,10 @@ import Foundation
case style
}
//--------------------------------------------------
// MARK: - Methods
//--------------------------------------------------
/// Defaults to set
open func setDefaults() {
if useHorizontalMargins == nil {
@ -37,11 +49,19 @@ import Foundation
}
}
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public override init() {
super.init()
setDefaults()
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
@ -52,7 +72,7 @@ import Foundation
try super.init(from: decoder)
setDefaults()
}
open override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
@ -63,4 +83,3 @@ import Foundation
try container.encodeIfPresent(style, forKey: .style)
}
}

View File

@ -78,6 +78,8 @@ import Foundation
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DropDownFilterTableViewCell.self, viewModelClass: DropDownListItemModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: AccordionMoleculeTableViewCell.self, viewModelClass: AccordionListItemModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TabsTableViewCell.self, viewModelClass: TabsListItemModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self)
// Other Items
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self)