Added view and model classes

This commit is contained in:
Kruthika KP 2020-03-13 11:29:58 +05:30
parent 5ff8d98e5b
commit ffbbe5df35
3 changed files with 129 additions and 6 deletions

View File

@ -112,10 +112,12 @@
525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; };
52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; };
52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; };
8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */; };
8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */; };
8D084A7F240CD9E500951227 /* (null) in Sources */ = {isa = PBXBuildFile; };
8D084A81240CDB5800951227 /* (null) in Sources */ = {isa = PBXBuildFile; };
8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; };
8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */; };
8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */; };
8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */; };
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; };
8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; };
8D448E5524050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; };
@ -468,6 +470,8 @@
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>"; };
52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethodModel.swift; sourceTree = "<group>"; };
8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaretModel.swift; sourceTree = "<group>"; };
8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaret.swift; sourceTree = "<group>"; };
8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyTextModel.swift; sourceTree = "<group>"; };
8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyText.swift; sourceTree = "<group>"; };
8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = "<group>"; };
@ -881,10 +885,10 @@
children = (
AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */,
AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */,
8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */,
8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */,
8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */,
C7F8012223E846C300396FBD /* ListRVWheelModel.swift */,
C7F8012023E8303200396FBD /* ListRVWheel.swift */,
8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */,
);
path = RightVariable;
sourceTree = "<group>";
@ -1732,6 +1736,7 @@
files = (
5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */,
0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */,
8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */,
943784F5236B77BB006A1E82 /* GraphView.swift in Sources */,
31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */,
94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */,
@ -1796,7 +1801,7 @@
D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */,
C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */,
D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */,
8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */,
8D084A7F240CD9E500951227 /* (null) in Sources */,
C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */,
014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */,
D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */,
@ -1844,7 +1849,7 @@
0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */,
94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */,
0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */,
8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */,
8D084A81240CDB5800951227 /* (null) in Sources */,
0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */,
D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */,
D2B18B812360945C00A9AEDC /* View.swift in Sources */,
@ -1934,6 +1939,7 @@
012CA99A2384A687003F810F /* MFTextField+ModelExtension.swift in Sources */,
01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */,
D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */,
8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */,
D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */,
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */,
D243859923A16B1800332775 /* Container.swift in Sources */,

View File

@ -0,0 +1,68 @@
//
// ListRightVariableTotalData.swift
// MVMCoreUI
//
// Created by Kruthika KP on 02/03/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
@objcMembers open class ListRightVariableTotalData: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
var stack: Stack<StackModel>
let leftLabel = Label.commonLabelB1(true)
let rightLabel = Label.commonLabelB2(true)
let bar = Line()
//-----------------------------------------------------
// MARK: - Initializers
//-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)),
(view: bar, model: StackItemModel(horizontalAlignment: .trailing)),
(view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))],
axis: .horizontal)
bar.widthAnchor.constraint(equalToConstant: 20).isActive = true
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
public required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//-----------------------------------------------------
// MARK: - View Lifecycle
//-------------------------------------------------------
override open func setupView() {
super.setupView()
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal)
addMolecule(stack)
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListRightVariableTotalDataModel else { return}
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
bar.set(with: model.bar, delegateObject, additionalData)
stack.restack()
}
open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{
return 90
}
open override func reset() {
super.reset()
leftLabel.styleB1(true)
rightLabel.styleB2(true)
bar.setStyle(.heavy)
}
}

View File

@ -0,0 +1,49 @@
//
// ListRightVariableTotalDataModel.swift
// MVMCoreUI
//
// Created by Kruthika KP on 02/03/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol {
public static var identifier: String = "listRVLine"
public var leftLabel: LabelModel
public var rightLabel: LabelModel
public var bar : LineModel
public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){
self.leftLabel = leftLabel
self.rightLabel = rightlabel
self.bar = bar
super.init()
}
private enum CodingKeys: String, CodingKey{
case moleculeName
case leftLabel
case rightLabel
case bar
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
bar = try typeContainer.decode(LineModel.self, forKey: .bar)
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(leftLabel, forKey: .leftLabel)
try container.encode(rightLabel, forKey: .rightLabel)
try container.encode(bar, forKey: .bar)
}
}