22011(iOS - List - Three Column - Bill History - Divider) initial commit.

This commit is contained in:
Lekshmi S 2020-08-07 17:51:11 +05:30
parent 92267ba93a
commit 96ebaaa380
4 changed files with 155 additions and 0 deletions

View File

@ -240,6 +240,8 @@
AAA905E124D1759A00D1EFAB /* ListThreeColumnBillHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */; };
AAB7EDEF246ADA1600E54929 /* ListProgressBarThinModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB7EDEE246ADA1600E54929 /* ListProgressBarThinModel.swift */; };
AAB7EDF1246ADA2A00E54929 /* ListProgressBarThin.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */; };
AAB8549824DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */; };
AAB8549A24DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */; };
AAB9C10824346F4B00151545 /* RadioSwatches.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C10724346F4B00151545 /* RadioSwatches.swift */; };
AAB9C10A243496DD00151545 /* RadioSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C109243496DD00151545 /* RadioSwatch.swift */; };
AAC6F167243332E400F295C1 /* RadioSwatchesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */; };
@ -717,6 +719,8 @@
AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistory.swift; sourceTree = "<group>"; };
AAB7EDEE246ADA1600E54929 /* ListProgressBarThinModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThinModel.swift; sourceTree = "<group>"; };
AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThin.swift; sourceTree = "<group>"; };
AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistoryDividerModel.swift; sourceTree = "<group>"; };
AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistoryDivider.swift; sourceTree = "<group>"; };
AAB9C10724346F4B00151545 /* RadioSwatches.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatches.swift; sourceTree = "<group>"; };
AAB9C109243496DD00151545 /* RadioSwatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatch.swift; sourceTree = "<group>"; };
AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatchesModel.swift; sourceTree = "<group>"; };
@ -1457,6 +1461,8 @@
AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */,
8DEFA95B243DAC20000D27E5 /* ListThreeColumnDataUsageDividerModel.swift */,
8DEFA95D243DAC2F000D27E5 /* ListThreeColumnDataUsageDivider.swift */,
AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */,
AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */,
);
path = ThreeColumn;
sourceTree = "<group>";
@ -2309,6 +2315,7 @@
D2E2A99C23D8D975000B42E6 /* ImageHeadlineBodyModel.swift in Sources */,
525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */,
D28A837F23CCA96400DFE4FC /* TabsModel.swift in Sources */,
AAB8549A24DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift in Sources */,
012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */,
8DDD6C1F244D90E1006A2232 /* ListThreeColumnDataUsageModel.swift in Sources */,
BB55B51F244482D2002001AD /* ListRightVariablePriceChangeBodyTextModel.swift in Sources */,
@ -2506,6 +2513,7 @@
BB2FB3BB247E7EBC00DF73CD /* TagCollectionViewCell.swift in Sources */,
012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */,
94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */,
AAB8549824DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift in Sources */,
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */,
D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */,
0A21DB94235E24ED00C160A2 /* DigitEntryField.swift in Sources */,

View File

@ -208,6 +208,7 @@ import Foundation
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillChangesDivider.self, viewModelClass: ListThreeColumnBillChangesDividerModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillHistoryDivider.self, viewModelClass: ListThreeColumnBillHistoryDividerModel.self)
// MARK:- Designed Headers
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self)

View File

@ -0,0 +1,80 @@
//
// ListThreeColumnBillHistoryDivider.swift
// MVMCoreUI
//
// Created by Lekshmi S on 06/08/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
@objcMembers open class ListThreeColumnBillHistoryDivider: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-------------------------------------------------------
public let leftLabel = Label(fontStyle: .BoldBodySmall)
public let centerLabel = Label(fontStyle: .BoldBodySmall)
public let rightLabel = Label(fontStyle: .BoldBodySmall)
var stack: Stack<StackModel>
//------------------------------------------------------
// MARK: - Initializers
//------------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 42, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 24, horizontalAlignment: .trailing))], axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
public required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//------------------------------------------------------
// MARK: - Lifecycle
//------------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
//--------------------------------------------------
// 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? ListThreeColumnBillHistoryDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
updateAccessibilityLabel()
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 121
}
open override func reset() {
super.reset()
leftLabel.setFontStyle(.BoldBodySmall)
centerLabel.setFontStyle(.BoldBodySmall)
rightLabel.setFontStyle(.BoldBodySmall)
}
//--------------------------------------------------
// MARK: - Accessibility
//--------------------------------------------------
func updateAccessibilityLabel() {
isAccessibilityElement = true
var message = ""
if let leftText = leftLabel.text, !leftText.isEmpty {
message += leftText + ", "
}
if let centerText = centerLabel.text, !centerText.isEmpty {
message += centerText + ", "
}
if let rightText = rightLabel.text, !rightText.isEmpty {
message += rightText
}
accessibilityLabel = message
}
}

View File

@ -0,0 +1,66 @@
//
// ListThreeColumnBillHistoryDividerModel.swift
// MVMCoreUI
//
// Created by Lekshmi S on 06/08/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
public class ListThreeColumnBillHistoryDividerModel: ListItemModel, MoleculeModelProtocol {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public static var identifier: String = "list3CBillHisDiv"
public var leftLabel: LabelModel
public var centerLabel: LabelModel
public var rightLabel: LabelModel
//-----------------------------------------------------
// MARK: - Initializer
//-----------------------------------------------------
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.centerLabel = centerLabel
self.rightLabel = rightLabel
super.init()
}
//-----------------------------------------------------
// MARK: - Method
//-----------------------------------------------------
override public func setDefaults() {
style = .tallDivider
super.setDefaults()
}
//-----------------------------------------------------
// MARK: - Keys
//-----------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
case centerLabel
case rightLabel
}
//-----------------------------------------------------
// MARK: - Codec
//-----------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel)
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(leftLabel, forKey: .leftLabel)
try container.encode(centerLabel, forKey: .centerLabel)
try container.encode(rightLabel, forKey: .rightLabel)
}
}