restructuring and commenting
This commit is contained in:
parent
7a9f9bd2c5
commit
0e6a4ef818
@ -78,6 +78,10 @@ import Foundation
|
|||||||
return 140
|
return 140
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Accessibility
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
func updateAccessibilityLabel() {
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
var message = ""
|
var message = ""
|
||||||
|
|||||||
@ -62,6 +62,7 @@ import Foundation
|
|||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
@ -80,6 +81,10 @@ import Foundation
|
|||||||
checkbox.isSelected.toggle()
|
checkbox.isSelected.toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
// MARK: - Accessibility
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
func updateAccessibilityLabel() {
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
var message = ""
|
var message = ""
|
||||||
|
|||||||
@ -7,8 +7,14 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRVWheel: TableViewCell {
|
@objcMembers open class ListRVWheel: TableViewCell {
|
||||||
let wheel = Wheel(frame: .zero)
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
let wheel = Wheel()
|
||||||
let leftLabel = Label.createLabelBoldBodySmall(true)
|
let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let rightLabel = Label.createLabelRegularBodySmall(true)
|
let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
@ -16,6 +22,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: wheel, model: StackItemModel(horizontalAlignment: .fill)),
|
(view: wheel, model: StackItemModel(horizontalAlignment: .fill)),
|
||||||
@ -31,6 +38,7 @@ import Foundation
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// MARK: - Setup
|
// MARK: - Setup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||||
@ -41,17 +49,17 @@ import Foundation
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// MARK: - MoleculeViewProtocol
|
// MARK: - MoleculeViewProtocol
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRVWheelModel else { return }
|
guard let model = model as? ListRVWheelModel else { return }
|
||||||
|
|
||||||
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
wheel.set(with: model.wheel, delegateObject, additionalData)
|
wheel.set(with: model.wheel, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// MARK: - MoleculeViewProtocol
|
|
||||||
//-------------------------------------------------
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.styleBoldBodySmall(true)
|
leftLabel.styleBoldBodySmall(true)
|
||||||
|
|||||||
@ -7,12 +7,22 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVWheel"
|
public static var identifier: String = "listRVWheel"
|
||||||
public var leftLabel: LabelModel
|
public var leftLabel: LabelModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var wheel: WheelModel
|
public var wheel: WheelModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(leftLabel: LabelModel, rightLabel: LabelModel, wheel: WheelModel) {
|
public init(leftLabel: LabelModel, rightLabel: LabelModel, wheel: WheelModel) {
|
||||||
self.leftLabel = leftLabel
|
self.leftLabel = leftLabel
|
||||||
self.rightLabel = rightLabel
|
self.rightLabel = rightLabel
|
||||||
@ -20,12 +30,19 @@ public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defaults to set
|
//--------------------------------------------------
|
||||||
|
// MARK: - Method
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
rightLabel.hero = 0
|
rightLabel.hero = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case leftLabel
|
case leftLabel
|
||||||
@ -33,6 +50,10 @@ public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
|
|||||||
case wheel
|
case wheel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
||||||
|
|||||||
@ -7,19 +7,24 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell {
|
@objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell {
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
|
||||||
public let button = PillButton(frame: .zero)
|
|
||||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
|
||||||
|
|
||||||
|
public var stack: Stack<StackModel>
|
||||||
|
public let button = PillButton()
|
||||||
|
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: button, model: StackItemModel(horizontalAlignment:.fill))],
|
(view: button, model: StackItemModel(horizontalAlignment: .fill))],
|
||||||
axis: .horizontal)
|
axis: .horizontal)
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
}
|
}
|
||||||
@ -29,23 +34,81 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
updateAccessibilityLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Molecular
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariableButtonAllTextAndLinksModel else { return }
|
guard let model = model as? ListRightVariableButtonAllTextAndLinksModel else { return }
|
||||||
|
|
||||||
button.set(with: model.button, delegateObject, additionalData)
|
button.set(with: model.button, delegateObject, additionalData)
|
||||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||||
|
updateAccessibilityLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 90
|
return 90
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
// MARK: - Accessibility
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
|
var message = ""
|
||||||
|
|
||||||
|
if let checkboxLabel = button.accessibilityLabel {
|
||||||
|
message += checkboxLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text {
|
||||||
|
message += eyebrowLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let headlineLabel = eyebrowHeadlineBodyLink.headline.text {
|
||||||
|
message += headlineLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let bodyLabel = eyebrowHeadlineBodyLink.body.text {
|
||||||
|
message += bodyLabel
|
||||||
|
}
|
||||||
|
|
||||||
|
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||||
|
|
||||||
|
isAccessibilityElement = !linkShowing
|
||||||
|
button.isAccessibilityElement = linkShowing
|
||||||
|
eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing
|
||||||
|
|
||||||
|
if !linkShowing {
|
||||||
|
// Make whole cell focusable if no link.
|
||||||
|
accessibilityLabel = message
|
||||||
|
} else {
|
||||||
|
// Allow only radio button and link to be focused on.
|
||||||
|
button.accessibilityLabel = message
|
||||||
|
var elements: [UIView] = []
|
||||||
|
|
||||||
|
if !message.isEmpty {
|
||||||
|
elements.append(button)
|
||||||
|
}
|
||||||
|
|
||||||
|
if linkShowing {
|
||||||
|
elements.append(eyebrowHeadlineBodyLink.link)
|
||||||
|
}
|
||||||
|
|
||||||
|
accessibilityElements = elements
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,30 +7,51 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVBtn"
|
public static var identifier: String = "listRVBtn"
|
||||||
public var button: ButtonModel
|
public var button: ButtonModel
|
||||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(button: ButtonModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
public init(button: ButtonModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
||||||
self.button = button
|
self.button = button
|
||||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defaults to set
|
//--------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
self.button.size = .tiny
|
self.button.size = .tiny
|
||||||
self.button.style = .secondary
|
self.button.style = .secondary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case button
|
case button
|
||||||
case eyebrowHeadlineBodyLink
|
case eyebrowHeadlineBodyLink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
button = try typeContainer.decode(ButtonModel.self, forKey: .button)
|
button = try typeContainer.decode(ButtonModel.self, forKey: .button)
|
||||||
@ -46,4 +67,3 @@ public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, Molecul
|
|||||||
try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink)
|
try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,11 +8,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariablePayments: TableViewCell {
|
@objcMembers open class ListRightVariablePayments: TableViewCell {
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-------------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
let leftLabel = Label.createLabelBoldBodySmall(true)
|
let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let rightImage = LoadImageView(pinnedEdges: .all)
|
let rightImage = LoadImageView(pinnedEdges: .all)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
@ -32,8 +33,9 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-------------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
rightImage.addSizeConstraintsForAspectRatio = true
|
rightImage.addSizeConstraintsForAspectRatio = true
|
||||||
@ -44,9 +46,12 @@ import Foundation
|
|||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariablePaymentsModel else { return }
|
guard let model = model as? ListRightVariablePaymentsModel else { return }
|
||||||
|
|
||||||
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
||||||
rightImage.set(with: model.image, delegateObject, additionalData)
|
rightImage.set(with: model.image, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,19 +8,30 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVImg"
|
public static var identifier: String = "listRVImg"
|
||||||
public var image: ImageViewModel
|
public var image: ImageViewModel
|
||||||
public var leftLabel: LabelModel
|
public var leftLabel: LabelModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(image: ImageViewModel, leftLabel: LabelModel) {
|
public init(image: ImageViewModel, leftLabel: LabelModel) {
|
||||||
self.leftLabel = leftLabel
|
self.leftLabel = leftLabel
|
||||||
self.image = image
|
self.image = image
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defaults to set
|
//--------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
leftLabel.hero = 0
|
leftLabel.hero = 0
|
||||||
@ -35,12 +46,20 @@ public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtoco
|
|||||||
return image
|
return image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case leftLabel
|
case leftLabel
|
||||||
case image
|
case image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
||||||
|
|||||||
@ -8,13 +8,14 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell {
|
@objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell {
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
|
||||||
public let arrow = Arrow(frame: .zero)
|
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||||
|
public let arrow = Arrow()
|
||||||
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
private let stack: Stack<StackModel>
|
private let stack: Stack<StackModel>
|
||||||
private let arrowStackItem: StackItem
|
private let arrowStackItem: StackItem
|
||||||
@ -23,6 +24,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
let stackModel = StackModel(molecules: [StackItemModel(horizontalAlignment: .leading),
|
let stackModel = StackModel(molecules: [StackItemModel(horizontalAlignment: .leading),
|
||||||
StackItemModel(horizontalAlignment: .fill),
|
StackItemModel(horizontalAlignment: .fill),
|
||||||
@ -40,7 +42,7 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
open override func alignAccessoryToHero() -> CGPoint? {
|
open override func alignAccessoryToHero() -> CGPoint? {
|
||||||
@ -52,11 +54,13 @@ import Foundation
|
|||||||
arrowStackItem.containerHelper.alignCenterVerticalConstraint?.constant = convertedPoint.y - stack.bounds.midY
|
arrowStackItem.containerHelper.alignCenterVerticalConstraint?.constant = convertedPoint.y - stack.bounds.midY
|
||||||
rightLabelStackItem.containerHelper.alignCenterVerticalConstraint?.constant = convertedPoint.y - stack.bounds.midY
|
rightLabelStackItem.containerHelper.alignCenterVerticalConstraint?.constant = convertedPoint.y - stack.bounds.midY
|
||||||
}
|
}
|
||||||
|
|
||||||
return heroCenter
|
return heroCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
|
|
||||||
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||||
rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||||
rightLabel.numberOfLines = 1
|
rightLabel.numberOfLines = 1
|
||||||
@ -67,9 +71,11 @@ import Foundation
|
|||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariablePriceChangeAllTextAndLinksModel else { return }
|
guard let model = model as? ListRightVariablePriceChangeAllTextAndLinksModel else { return }
|
||||||
|
|
||||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
arrow.set(with: model.arrow, delegateObject, additionalData)
|
arrow.set(with: model.arrow, delegateObject, additionalData)
|
||||||
@ -78,5 +84,56 @@ import Foundation
|
|||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 121
|
return 121
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Accessibility
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
|
var message = ""
|
||||||
|
|
||||||
|
checkbox.updateAccessibilityLabel()
|
||||||
|
|
||||||
|
if let checkboxLabel = checkbox.accessibilityLabel {
|
||||||
|
message += checkboxLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text {
|
||||||
|
message += eyebrowLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let headlineLabel = eyebrowHeadlineBodyLink.headline.text {
|
||||||
|
message += headlineLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let bodyLabel = eyebrowHeadlineBodyLink.body.text {
|
||||||
|
message += bodyLabel
|
||||||
|
}
|
||||||
|
|
||||||
|
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||||
|
|
||||||
|
isAccessibilityElement = !linkShowing
|
||||||
|
checkbox.isAccessibilityElement = linkShowing
|
||||||
|
eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing
|
||||||
|
|
||||||
|
if !linkShowing {
|
||||||
|
// Make whole cell focusable if no link.
|
||||||
|
accessibilityLabel = message
|
||||||
|
} else {
|
||||||
|
// Allow only radio button and link to be focused on.
|
||||||
|
checkbox.accessibilityLabel = message
|
||||||
|
var elements: [UIView] = []
|
||||||
|
|
||||||
|
if message.count > 0 {
|
||||||
|
elements.append(checkbox)
|
||||||
|
}
|
||||||
|
|
||||||
|
if linkShowing {
|
||||||
|
elements.append(eyebrowHeadlineBodyLink.link)
|
||||||
|
}
|
||||||
|
|
||||||
|
accessibilityElements = elements
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,12 +8,21 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVArwAll"
|
public static var identifier: String = "listRVArwAll"
|
||||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var arrow: ArrowModel
|
public var arrow: ArrowModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel, rightLabel: LabelModel, arrow: ArrowModel) {
|
public init(eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel, rightLabel: LabelModel, arrow: ArrowModel) {
|
||||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||||
self.rightLabel = rightLabel
|
self.rightLabel = rightLabel
|
||||||
@ -21,6 +30,10 @@ public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, Mo
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case eyebrowHeadlineBodyLink
|
case eyebrowHeadlineBodyLink
|
||||||
@ -28,6 +41,10 @@ public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, Mo
|
|||||||
case arrow
|
case arrow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
|
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
|
||||||
|
|||||||
@ -7,19 +7,23 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariablePriceChangeBodyText: TableViewCell {
|
@objcMembers open class ListRightVariablePriceChangeBodyText: TableViewCell {
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
private let stack: Stack<StackModel>
|
private let stack: Stack<StackModel>
|
||||||
public let headlineBody = HeadlineBody(frame: .zero)
|
public let headlineBody = HeadlineBody()
|
||||||
public let arrow = Arrow(frame: .zero)
|
public let arrow = Arrow()
|
||||||
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
let arrowAndRightLabelStack: Stack<StackModel>
|
let arrowAndRightLabelStack: Stack<StackModel>
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
arrowAndRightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
|
arrowAndRightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
|
||||||
(view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))],
|
(view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))],
|
||||||
@ -35,8 +39,9 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
headlineBody.styleListItem()
|
headlineBody.styleListItem()
|
||||||
@ -51,9 +56,15 @@ import Foundation
|
|||||||
arrowAndRightLabelStack.restack()
|
arrowAndRightLabelStack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
//--------------------------------------------------
|
||||||
|
// MARK: - Molecular
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariablePriceChangeBodyTextModel else { return }
|
guard let model = model as? ListRightVariablePriceChangeBodyTextModel else { return }
|
||||||
|
|
||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
arrow.set(with: model.arrow, delegateObject, additionalData)
|
arrow.set(with: model.arrow, delegateObject, additionalData)
|
||||||
|
|||||||
@ -7,12 +7,22 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVArwBdy"
|
public static var identifier: String = "listRVArwBdy"
|
||||||
public var headlineBody: HeadlineBodyModel
|
public var headlineBody: HeadlineBodyModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var arrow: ArrowModel
|
public var arrow: ArrowModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(headlineBody: HeadlineBodyModel,rightLabel: LabelModel,arrow: ArrowModel) {
|
public init(headlineBody: HeadlineBodyModel,rightLabel: LabelModel,arrow: ArrowModel) {
|
||||||
self.headlineBody = headlineBody
|
self.headlineBody = headlineBody
|
||||||
self.rightLabel = rightLabel
|
self.rightLabel = rightLabel
|
||||||
@ -20,7 +30,10 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defaults to set
|
//--------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
if let headline = headlineBody.headline {
|
if let headline = headlineBody.headline {
|
||||||
@ -28,6 +41,10 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case headlineBody
|
case headlineBody
|
||||||
@ -35,6 +52,10 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
case arrow
|
case arrow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
|
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
|
||||||
|
|||||||
@ -7,16 +7,21 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariableTextLinkAllTextAndLinks: TableViewCell {
|
@objcMembers open class ListRightVariableTextLinkAllTextAndLinks: TableViewCell {
|
||||||
|
//--------------------------------------------------
|
||||||
//-----------------------------------------------------
|
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//--------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
|
||||||
public let link = Link(frame: .zero)
|
|
||||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
|
||||||
|
|
||||||
|
public var stack: Stack<StackModel>
|
||||||
|
public let link = Link()
|
||||||
|
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)),
|
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)),
|
||||||
(view: link, model: StackItemModel(horizontalAlignment:.fill, verticalAlignment: .top))],
|
(view: link, model: StackItemModel(horizontalAlignment:.fill, verticalAlignment: .top))],
|
||||||
@ -29,17 +34,24 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
//--------------------------------------------------
|
||||||
|
// MARK: - Molecular
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariableTextLinkAllTextAndLinksModel else { return }
|
guard let model = model as? ListRightVariableTextLinkAllTextAndLinksModel else { return }
|
||||||
|
|
||||||
link.set(with: model.link, delegateObject, additionalData)
|
link.set(with: model.link, delegateObject, additionalData)
|
||||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,23 +7,41 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariableTextLinkAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariableTextLinkAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVLink"
|
public static var identifier: String = "listRVLink"
|
||||||
public var link: LinkModel
|
public var link: LinkModel
|
||||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(link: LinkModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
public init(link: LinkModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
||||||
self.link = link
|
self.link = link
|
||||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case link
|
case link
|
||||||
case eyebrowHeadlineBodyLink
|
case eyebrowHeadlineBodyLink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
link = try typeContainer.decode(LinkModel.self, forKey: .link)
|
link = try typeContainer.decode(LinkModel.self, forKey: .link)
|
||||||
|
|||||||
@ -8,11 +8,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListRightVariableTotalData: TableViewCell {
|
@objcMembers open class ListRightVariableTotalData: TableViewCell {
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let leftLabel = Label.createLabelBoldBodySmall(true)
|
public let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
@ -35,8 +36,8 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - Lifecycle
|
||||||
//-------------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
@ -47,15 +48,21 @@ import Foundation
|
|||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){
|
//--------------------------------------------------
|
||||||
|
// MARK: - Molecular
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListRightVariableTotalDataModel else { return }
|
guard let model = model as? ListRightVariableTotalDataModel else { return }
|
||||||
|
|
||||||
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
bar.set(with: model.bar, delegateObject, additionalData)
|
bar.set(with: model.bar, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{
|
open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 70
|
return 70
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,13 +8,21 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol {
|
public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listRVLine"
|
public static var identifier: String = "listRVLine"
|
||||||
public var leftLabel: LabelModel
|
public var leftLabel: LabelModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var bar: LineModel
|
public var bar: LineModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Method
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
rightLabel.hero = 0
|
rightLabel.hero = 0
|
||||||
@ -24,13 +32,21 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
public init(leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){
|
||||||
self.leftLabel = leftLabel
|
self.leftLabel = leftLabel
|
||||||
self.rightLabel = rightlabel
|
self.rightLabel = rightlabel
|
||||||
self.bar = bar
|
self.bar = bar
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey{
|
private enum CodingKeys: String, CodingKey{
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case leftLabel
|
case leftLabel
|
||||||
@ -38,6 +54,10 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc
|
|||||||
case bar
|
case bar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user