referencing error
This commit is contained in:
parent
2a354d2a53
commit
7c4401f4ac
@ -1,75 +0,0 @@
|
||||
//
|
||||
// ListTwoColumnPriceDetails.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 19/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
|
||||
|
||||
let leftLabel = Label.commonLabelB2(true)
|
||||
let rightLabel = Label.commonLabelB2(true)
|
||||
let rightSubLabel = Label.commonLabelB2(true)
|
||||
let containerView = View()
|
||||
let spaceBetweenleftLabelAndRightlabel: CGFloat = 40.0
|
||||
|
||||
// MARK: - MFViewProtocol
|
||||
open override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
containerView.updateView(size)
|
||||
leftLabel.updateView(size)
|
||||
rightLabel.updateView(size)
|
||||
rightSubLabel.updateView(size)
|
||||
}
|
||||
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
guard leftLabel.superview == nil else {
|
||||
return
|
||||
}
|
||||
containerView.translatesAutoresizingMaskIntoConstraints = false
|
||||
containerView.addSubview(leftLabel)
|
||||
containerView.addSubview(rightLabel)
|
||||
containerView.addSubview(rightSubLabel)
|
||||
contentView.addSubview(containerView)
|
||||
//containerView constraints
|
||||
containerHelper.constrainView(containerView)
|
||||
|
||||
//leftLabel constraints
|
||||
leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true
|
||||
leftLabel.topAnchor.constraint(equalTo: rightLabel.topAnchor).isActive = true
|
||||
containerView.bottomAnchor.constraint(equalTo: leftLabel.bottomAnchor).isActive = true
|
||||
//rightLabel constraints
|
||||
rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor, constant: spaceBetweenleftLabelAndRightlabel).isActive = true
|
||||
rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true
|
||||
rightLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true
|
||||
rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 902), for: .horizontal)
|
||||
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 902), for: .horizontal)
|
||||
//rightSubLabel constraints
|
||||
rightSubLabel.topAnchor.constraint(equalTo: rightLabel.bottomAnchor).isActive = true
|
||||
rightSubLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true
|
||||
containerView.bottomAnchor.constraint(greaterThanOrEqualTo: rightSubLabel.bottomAnchor).isActive = true
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
guard let model = model as? ListTwoColumnPriceDetailsModel else { return }
|
||||
leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData)
|
||||
rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData)
|
||||
rightSubLabel.setWithModel(model.rightSubLabel, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
leftLabel.reset()
|
||||
rightLabel.reset()
|
||||
rightSubLabel.reset()
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 60
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
//
|
||||
// ListTwoColumnPriceDetailsModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 19/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol {
|
||||
public static var identifier: String = "list2CTxtPrc2"
|
||||
public var leftLabel: LabelModel
|
||||
public var rightLabel: LabelModel
|
||||
public var rightSubLabel: LabelModel
|
||||
|
||||
public init(leftLabel: LabelModel, rightLabel:LabelModel, rightSubLabel: LabelModel) {
|
||||
self.leftLabel = leftLabel
|
||||
self.rightLabel = rightLabel
|
||||
self.rightSubLabel = rightSubLabel
|
||||
super.init()
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case leftLabel
|
||||
case rightLabel
|
||||
case rightSubLabel
|
||||
}
|
||||
|
||||
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)
|
||||
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(leftLabel, forKey: .leftLabel)
|
||||
try container.encode(rightLabel, forKey: .rightLabel)
|
||||
try container.encode(rightSubLabel, forKey: .rightSubLabel)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user