Added ListOneColumnFullWidthTextAllTextAndLinks molecule class and model files.
This commit is contained in:
parent
d70bde5b65
commit
47603e7a59
@ -98,6 +98,8 @@
|
||||
31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; };
|
||||
522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; };
|
||||
522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679C023FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift */; };
|
||||
52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */; };
|
||||
52267A0923FFE28200906CBA /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52267A0823FFE28200906CBA /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; };
|
||||
5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */; };
|
||||
5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; };
|
||||
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; };
|
||||
@ -428,6 +430,8 @@
|
||||
31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = "<group>"; };
|
||||
522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = "<group>"; };
|
||||
522679C023FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinksModel.swift; sourceTree = "<group>"; };
|
||||
52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinks.swift; sourceTree = "<group>"; };
|
||||
52267A0823FFE28200906CBA /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinksModel.swift; sourceTree = "<group>"; };
|
||||
5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDivider.swift; sourceTree = "<group>"; };
|
||||
5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = "<group>"; };
|
||||
8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = "<group>"; };
|
||||
@ -763,6 +767,15 @@
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52267A0523FFE0A900906CBA /* OneColumn */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */,
|
||||
52267A0823FFE28200906CBA /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */,
|
||||
);
|
||||
path = OneColumn;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
946EE1B5237B663A0036751F /* Extensions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -1006,6 +1019,7 @@
|
||||
D22B38EC23F4E10700490EF6 /* SectionDividers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52267A0523FFE0A900906CBA /* OneColumn */,
|
||||
D22B38ED23F4E11100490EF6 /* ThreeColumn */,
|
||||
);
|
||||
path = SectionDividers;
|
||||
@ -1672,6 +1686,7 @@
|
||||
D2E2A98323D8B32D000B42E6 /* EyebrowHeadlineBodyLinkModel.swift in Sources */,
|
||||
012A88AD238C418100FE3DA1 /* TemplateProtocol.swift in Sources */,
|
||||
D29DF2B421E7B76D003B2FB9 /* MFLoadingSpinner.m in Sources */,
|
||||
52267A0923FFE28200906CBA /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */,
|
||||
D260106323D0C05000764D80 /* StackItemModel.swift in Sources */,
|
||||
D2E2A99823D8D63C000B42E6 /* ActionDetailWithImageModel.swift in Sources */,
|
||||
D2E2A99D23DA3217000B42E6 /* UIStackViewAlignment+Extension.swift in Sources */,
|
||||
@ -1847,6 +1862,7 @@
|
||||
012A88F123985E0100FE3DA1 /* Color.swift in Sources */,
|
||||
012A889C23889E8400FE3DA1 /* TemplateModelProtocol.swift in Sources */,
|
||||
D29770FC21F7C77400B2F0D0 /* MVMCoreUITextFieldView.m in Sources */,
|
||||
52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */,
|
||||
C003506123AA94CD00B6AC29 /* Button.swift in Sources */,
|
||||
DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */,
|
||||
0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */,
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
//
|
||||
// ListOneColumnFullWidthTextAllTextAndLinks.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kruthika KP on 14/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ListOneColumnFullWidthTextAllTextAndLinks: TableViewCell {
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-----------------------------------------------------
|
||||
|
||||
let stack = Stack<StackModel>(frame: .zero)
|
||||
let eyebrow = Label.commonLabelB3(true)
|
||||
let headline = Label.commonLabelH3(true)
|
||||
let subHeadline = Label.commonLabelB1(true)
|
||||
let body = Label.commonLabelB2(true)
|
||||
let link = Link()
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - View Lifecycle
|
||||
//-------------------------------------------------------
|
||||
|
||||
open override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
stack.updateView(size)
|
||||
}
|
||||
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
guard stack.superview == nil else {
|
||||
return
|
||||
}
|
||||
stack.translatesAutoresizingMaskIntoConstraints = false
|
||||
stack.stackItems = [StackItem(andContain: eyebrow),StackItem(andContain: headline),StackItem(andContain: subHeadline),StackItem(andContain: body),StackItem(andContain: link)]
|
||||
contentView.addSubview(stack)
|
||||
containerHelper.constrainView(stack)
|
||||
}
|
||||
//----------------------------------------------------
|
||||
// MARK: - Molecule
|
||||
//------------------------------------------------------
|
||||
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
stack.reset()
|
||||
eyebrow.styleB3(true)
|
||||
headline.styleH3(true)
|
||||
subHeadline.styleB1(true)
|
||||
body.styleB2(true)
|
||||
}
|
||||
|
||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
guard let model = model as? ListOneColumnFullWidthTextAllTextAndLinksModel else { return}
|
||||
eyebrow.setWithModel(model.eyebrow, delegateObject, additionalData)
|
||||
headline.setWithModel(model.headline, delegateObject, additionalData)
|
||||
subHeadline.setWithModel(model.subHeadline, delegateObject, additionalData)
|
||||
body.setWithModel(model.body, delegateObject, additionalData)
|
||||
link.setWithModel(model.link, delegateObject, additionalData)
|
||||
|
||||
let stackModel = StackModel(molecules: [StackItemModel(gone: !eyebrow.hasText),StackItemModel(gone: !headline.hasText),StackItemModel(gone: !subHeadline.hasText),StackItemModel(gone: !body.hasText),StackItemModel(gone: (link.titleLabel?.text?.count ?? 0) == 0)])
|
||||
stack.model = stackModel
|
||||
stackModel.spacing = 2
|
||||
stack.restack()
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return 90
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
//
|
||||
// ListOneColumnFullWidthTextAllTextAndLinksModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kruthika KP on 14/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListOneColumnFullWidthTextAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
public static var identifier: String = "list1CTxt"
|
||||
public var eyebrow: LabelModel?
|
||||
public var headline : LabelModel?
|
||||
public var subHeadline: LabelModel?
|
||||
public var body: LabelModel?
|
||||
public var link : LinkModel?
|
||||
|
||||
public init(eyebrow:LabelModel, headline: LabelModel, subHeadline: LabelModel, body: LabelModel, link: LinkModel) {
|
||||
self.eyebrow = eyebrow
|
||||
self.headline = headline
|
||||
self.subHeadline = subHeadline
|
||||
self.body = body
|
||||
self.link = link
|
||||
super.init()
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case eyebrow
|
||||
case headline
|
||||
case subHeadline
|
||||
case body
|
||||
case link
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
eyebrow = try typeContainer.decode(LabelModel.self, forKey: .eyebrow)
|
||||
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)
|
||||
subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline)
|
||||
body = try typeContainer.decode(LabelModel.self, forKey: .body)
|
||||
link = try typeContainer.decode(LinkModel.self, forKey: .link)
|
||||
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(eyebrow, forKey: .eyebrow)
|
||||
try container.encode(headline, forKey: .headline)
|
||||
try container.encode(subHeadline, forKey: .subHeadline)
|
||||
try container.encode(body, forKey: .body)
|
||||
try container.encode(link, forKey: .link)
|
||||
}
|
||||
}
|
||||
@ -55,6 +55,8 @@ import Foundation
|
||||
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StringAndMoleculeView.self, viewModelClass: StringAndMoleculeModel.self)
|
||||
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ImageHeadlineBody.self, viewModelClass: ImageHeadlineBodyModel.self)
|
||||
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self)
|
||||
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self)
|
||||
|
||||
|
||||
|
||||
// Vertical Combination Molecules
|
||||
|
||||
Loading…
Reference in New Issue
Block a user