moved files
This commit is contained in:
parent
35085217d5
commit
779efbcd07
@ -1,82 +0,0 @@
|
||||
//
|
||||
// ListTwoColumnPriceDescription.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kruthika KP on 24/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListTwoColumnPriceDescription: TableViewCell {
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
let leftHeadline = Label.commonLabelB1(true)
|
||||
let leftBody = Label.commonLabelB2(true)
|
||||
let rightLabel = Label.commonLabelB2(true)
|
||||
let rightSubLabel = Label.commonLabelB2(true)
|
||||
let view = View()
|
||||
|
||||
let leftVerticalStack = UIStackView()
|
||||
let rightVerticalStack = UIStackView()
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - View Lifecycle
|
||||
//-------------------------------------------------------
|
||||
open override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
leftHeadline.updateView(size)
|
||||
leftBody.updateView(size)
|
||||
rightLabel.updateView(size)
|
||||
rightSubLabel.updateView(size)
|
||||
}
|
||||
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
contentView.addSubview(view)
|
||||
containerHelper.constrainView(view)
|
||||
|
||||
rightLabel.numberOfLines = 1
|
||||
rightSubLabel.numberOfLines = 1
|
||||
leftVerticalStack.translatesAutoresizingMaskIntoConstraints = false
|
||||
rightVerticalStack.translatesAutoresizingMaskIntoConstraints = false
|
||||
leftVerticalStack.addArrangedSubview(leftHeadline)
|
||||
leftVerticalStack.addArrangedSubview(leftBody)
|
||||
leftVerticalStack.axis = .vertical
|
||||
leftVerticalStack.alignment = .leading
|
||||
rightVerticalStack.addArrangedSubview(rightLabel)
|
||||
rightVerticalStack.addArrangedSubview(rightSubLabel)
|
||||
rightVerticalStack.axis = .vertical
|
||||
rightVerticalStack.alignment = .trailing
|
||||
view.addSubview(leftVerticalStack)
|
||||
view.addSubview(rightVerticalStack)
|
||||
NSLayoutConstraint.pinViews(leftView: leftVerticalStack, rightView: rightVerticalStack, alignTop: true)
|
||||
}
|
||||
//----------------------------------------------------
|
||||
// MARK: - Molecule
|
||||
//------------------------------------------------------
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListTwoColumnPriceDescriptionModel else { return}
|
||||
leftHeadline.set(with: model.leftHeadline, delegateObject, additionalData)
|
||||
leftBody.set(with: model.leftBody, delegateObject, additionalData)
|
||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||
rightSubLabel.set(with: model.rightSubLabel, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return 90
|
||||
}
|
||||
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
leftHeadline.styleB1(true)
|
||||
leftBody.styleB2(true)
|
||||
rightLabel.styleB2(true)
|
||||
rightSubLabel.styleB2(true)
|
||||
}
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
//
|
||||
// ListTwoColumnPriceDescriptionModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kruthika KP on 26/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelProtocol {
|
||||
public static var identifier: String = "list2CTxtPrc1"
|
||||
public var leftHeadline: LabelModel
|
||||
public var leftBody: LabelModel
|
||||
public var rightLabel: LabelModel
|
||||
public var rightSubLabel: LabelModel
|
||||
|
||||
override public func setDefaults() {
|
||||
super.setDefaults()
|
||||
rightLabel.hero = 0
|
||||
}
|
||||
|
||||
public init(leftHeadline: LabelModel,leftBody: LabelModel, rightLabel: LabelModel, rightSubLabel: LabelModel) {
|
||||
self.leftHeadline = leftHeadline
|
||||
self.leftBody = leftBody
|
||||
self.rightLabel = rightLabel
|
||||
self.rightSubLabel = rightSubLabel
|
||||
super.init()
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case leftHeadline
|
||||
case leftBody
|
||||
case rightLabel
|
||||
case rightSubLabel
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
leftHeadline = try typeContainer.decode(LabelModel.self, forKey: .leftHeadline)
|
||||
leftBody = try typeContainer.decode(LabelModel.self, forKey: .leftBody)
|
||||
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
|
||||
rightSubLabel = try typeContainer.decode(LabelModel.self, forKey: .rightSubLabel)
|
||||
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(leftHeadline, forKey: .leftHeadline)
|
||||
try container.encode(leftBody, forKey: .leftBody)
|
||||
try container.encode(rightLabel, forKey: .rightLabel)
|
||||
try container.encode(rightSubLabel, forKey: .rightSubLabel)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user