From 3fbbe00761a43a45cd8dd5855f72355cd88f6bd6 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Wed, 19 Feb 2020 15:28:51 +0530 Subject: [PATCH 01/10] 19096 - List - Progress Bar - Data - Initial commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ .../LeftVariable/ListProgressBarData.swift | 89 +++++++++++++++++++ .../ListProgressBarDataModel.swift | 55 ++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 2 + 4 files changed, 154 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 03743382..0d9eafc8 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -100,6 +100,8 @@ 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; }; + 8D4B80E623FD332F00CC7B07 /* ListProgressBarDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */; }; + 8D4B80E723FD332F00CC7B07 /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */; }; 9432A79F23DB47BA00719041 /* EntryFieldContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */; }; 943784F5236B77BB006A1E82 /* GraphView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943784F3236B77BB006A1E82 /* GraphView.swift */; }; 943784F6236B77BB006A1E82 /* GraphViewAnimationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943784F4236B77BB006A1E82 /* GraphViewAnimationHandler.swift */; }; @@ -424,6 +426,8 @@ 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretModel.swift; sourceTree = ""; }; + 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarDataModel.swift; sourceTree = ""; }; + 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = ""; }; 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = ""; }; 9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EntryFieldContainer.swift; sourceTree = ""; }; 943784F3236B77BB006A1E82 /* GraphView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphView.swift; sourceTree = ""; }; @@ -971,6 +975,8 @@ D22B38EB23F4E0AE00490EF6 /* LeftVariable */ = { isa = PBXGroup; children = ( + 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */, + 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */, 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */, 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */, ); @@ -1708,6 +1714,7 @@ D2B18B812360945C00A9AEDC /* View.swift in Sources */, C6FA7D5423C77A4A00A3614A /* NumberedList.swift in Sources */, D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */, + 8D4B80E723FD332F00CC7B07 /* ListProgressBarData.swift in Sources */, 0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */, 94FB966323D797DA003D482B /* MFTextButton.m in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, @@ -1725,6 +1732,7 @@ 0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */, 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */, 0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */, + 8D4B80E623FD332F00CC7B07 /* ListProgressBarDataModel.swift in Sources */, 011B58F023A2AA980085F53C /* ListItemModelProtocol.swift in Sources */, D22479962316AF6E003FCCF9 /* HeadlineBodyLink.swift in Sources */, D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift new file mode 100644 index 00000000..7a57a78b --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift @@ -0,0 +1,89 @@ +// +// ListProgressBarData.swift +// MVMCoreUI +// +// Created by Kruthika KP on 18/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +import UIKit + +@objcMembers public class ListProgressBarData: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + + let progressBar = MultiProgress(frame: .zero) + let leftLabel = Label.commonLabelB1(true) + let rightLabel = Label.commonLabelB1(true) + let view = View() + let horizontalPadding = MFStyler.defaultHorizontalPaddingForApplicationWidth() + + //----------------------------------------------------- + // MARK: - View Lifecycle + //----------------------------------------------------- + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + progressBar.updateView(size) + leftLabel.updateView(size) + rightLabel.updateView(size) + + } + + override open func setupView() { + super.setupView() + guard leftLabel.superview == nil else { + return + } + + contentView.addSubview(view) + view.addSubview(progressBar) + view.addSubview(leftLabel) + view.addSubview(rightLabel) + containerHelper.constrainView(view) + + //constraints + + leftLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + leftLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true + + rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor,constant: horizontalPadding).isActive = true + rightLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + rightLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true + + progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true + progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + override open func reset() { + super.reset() + progressBar.reset() + leftLabel.reset() + rightLabel.reset() + + } + + public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.setWithModel(model, delegateObject, additionalData) + guard let model = model as? ListProgressBarDataModel else { return} + progressBar.setWithModel(model.progressBar, delegateObject, additionalData) + leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) + rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) +} + + public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + +} + diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift new file mode 100644 index 00000000..1b4ccaba --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift @@ -0,0 +1,55 @@ +// +// ListProgressBarDataModel.swift +// MVMCoreUI +// +// Created by Kruthika KP on 18/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "listPrgBar" + + public var progressBar : MultiProgressBarModel + public var leftLabel: LabelModel + public var rightLabel: LabelModel + + override public func setDefaults() { + super.setDefaults() + + } + + public init (progressBar: MultiProgressBarModel, leftLabel: LabelModel, rightLabel: LabelModel){ + self.progressBar = progressBar + self.leftLabel = leftLabel + self.rightLabel = rightLabel + super.init() + } + + private enum CodingKeys: String, CodingKey{ + case moleculeName + case progressBar + case leftLabel + case rightLabel + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + progressBar = try typeContainer.decode(MultiProgressBarModel.self, forKey: .progressBar) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + 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(progressBar, forKey: .progressBar) + try container.encode(leftLabel, forKey: .leftLabel) + try container.encode(rightLabel, forKey: .rightLabel) + + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index a04f964a..cda35b63 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -78,6 +78,8 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DropDownFilterTableViewCell.self, viewModelClass: DropDownListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: AccordionMoleculeTableViewCell.self, viewModelClass: AccordionListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TabsTableViewCell.self, viewModelClass: TabsListItemModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self) + // Other Items MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self) From cc7ee029ef2a92f5ad50955dfb26ff022bf91363 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Tue, 25 Feb 2020 14:56:17 +0530 Subject: [PATCH 02/10] Change in molecule name --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++---- .../List/LeftVariable/ListProgressBarDataModel.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 0d9eafc8..07c7f61d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -100,7 +100,7 @@ 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; }; - 8D4B80E623FD332F00CC7B07 /* ListProgressBarDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */; }; + 8D448E5724051C53006211BB /* ListProgressBarDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5624051C53006211BB /* ListProgressBarDataModel.swift */; }; 8D4B80E723FD332F00CC7B07 /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */; }; 9432A79F23DB47BA00719041 /* EntryFieldContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */; }; 943784F5236B77BB006A1E82 /* GraphView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943784F3236B77BB006A1E82 /* GraphView.swift */; }; @@ -426,7 +426,7 @@ 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretModel.swift; sourceTree = ""; }; - 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarDataModel.swift; sourceTree = ""; }; + 8D448E5624051C53006211BB /* ListProgressBarDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarDataModel.swift; sourceTree = ""; }; 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = ""; }; 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = ""; }; 9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EntryFieldContainer.swift; sourceTree = ""; }; @@ -975,8 +975,8 @@ D22B38EB23F4E0AE00490EF6 /* LeftVariable */ = { isa = PBXGroup; children = ( + 8D448E5624051C53006211BB /* ListProgressBarDataModel.swift */, 8D4B80E523FD332D00CC7B07 /* ListProgressBarData.swift */, - 8D4B80E423FD332C00CC7B07 /* ListProgressBarDataModel.swift */, 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */, 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */, ); @@ -1732,7 +1732,6 @@ 0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */, 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */, 0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */, - 8D4B80E623FD332F00CC7B07 /* ListProgressBarDataModel.swift in Sources */, 011B58F023A2AA980085F53C /* ListItemModelProtocol.swift in Sources */, D22479962316AF6E003FCCF9 /* HeadlineBodyLink.swift in Sources */, D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */, @@ -1829,6 +1828,7 @@ 0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */, 0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */, C7192E7D23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift in Sources */, + 8D448E5724051C53006211BB /* ListProgressBarDataModel.swift in Sources */, D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */, D29DF29C21E7ADB9003B2FB9 /* MFProgrammaticTableViewController.m in Sources */, 0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift index 1b4ccaba..1e25c067 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift @@ -9,7 +9,7 @@ import Foundation public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { - public static var identifier: String = "listPrgBar" + public static var identifier: String = "listPrgBarData" public var progressBar : MultiProgressBarModel public var leftLabel: LabelModel From ba51d7f3c264729ab55a5ee17de2469880a26b72 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Wed, 26 Feb 2020 11:44:17 +0530 Subject: [PATCH 03/10] Change in reference file, indentation and removal of extra spaces. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++++++ .../List/LeftVariable/ListProgressBarData.swift | 4 +--- .../List/LeftVariable/ListProgressBarDataModel.swift | 12 +++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 95bd45b6..0fc24c53 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -101,6 +101,8 @@ 52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */; }; 5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */; }; 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; }; + 525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */; }; + 525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DC2406430800EED91C /* ListProgressBarData.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; }; 8D448E5524050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; }; @@ -435,6 +437,8 @@ 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinks.swift; sourceTree = ""; }; 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDivider.swift; sourceTree = ""; }; 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = ""; }; + 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarDataModel.swift; sourceTree = ""; }; + 525019DC2406430800EED91C /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretModel.swift; sourceTree = ""; }; 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -1013,6 +1017,8 @@ D22B38EB23F4E0AE00490EF6 /* LeftVariable */ = { isa = PBXGroup; children = ( + 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, + 525019DC2406430800EED91C /* ListProgressBarData.swift */, 522679C023FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift */, 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */, 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */, @@ -1734,6 +1740,7 @@ D213347723843825008E41B3 /* Line.swift in Sources */, D28A837723C79FC600DFE4FC /* MFCustomButton+ActionModel.swift in Sources */, D2E2A99C23D8D975000B42E6 /* ImageHeadlineBodyModel.swift in Sources */, + 525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */, D28A837F23CCA96400DFE4FC /* TabsModel.swift in Sources */, 012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */, D2A514672213885800345BFB /* MoleculeHeaderView.swift in Sources */, @@ -1895,6 +1902,7 @@ D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */, 94C661D923CCF4B400D9FE5B /* LeftRightLabelModel.swift in Sources */, D21EE53C23AD3AD4003D1A30 /* NSLayoutConstraintAxis+Extension.swift in Sources */, + 525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */, C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */, 01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */, 0105618D224BBE7700E1557D /* FormValidator.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift index 7a57a78b..06d63845 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift @@ -78,12 +78,10 @@ import UIKit progressBar.setWithModel(model.progressBar, delegateObject, additionalData) leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) -} + } public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 90 } - - } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift index 1e25c067..b7917739 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift @@ -17,7 +17,6 @@ public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { override public func setDefaults() { super.setDefaults() - } public init (progressBar: MultiProgressBarModel, leftLabel: LabelModel, rightLabel: LabelModel){ @@ -40,16 +39,15 @@ public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) 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(progressBar, forKey: .progressBar) - try container.encode(leftLabel, forKey: .leftLabel) - try container.encode(rightLabel, forKey: .rightLabel) - + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(progressBar, forKey: .progressBar) + try container.encode(leftLabel, forKey: .leftLabel) + try container.encode(rightLabel, forKey: .rightLabel) + } } From 62e1d28305e964e4b8c8b81c14c8dd053d767f55 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Wed, 26 Feb 2020 16:33:18 +0530 Subject: [PATCH 04/10] Constraints added --- .../LeftVariable/ListProgressBarData.swift | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift index 06d63845..466439a1 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift @@ -19,7 +19,6 @@ import UIKit let leftLabel = Label.commonLabelB1(true) let rightLabel = Label.commonLabelB1(true) let view = View() - let horizontalPadding = MFStyler.defaultHorizontalPaddingForApplicationWidth() //----------------------------------------------------- // MARK: - View Lifecycle @@ -35,10 +34,7 @@ import UIKit override open func setupView() { super.setupView() - guard leftLabel.superview == nil else { - return - } - + contentView.addSubview(view) view.addSubview(progressBar) view.addSubview(leftLabel) @@ -47,30 +43,17 @@ import UIKit //constraints - leftLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - leftLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true - - rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor,constant: horizontalPadding).isActive = true - rightLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - rightLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true - + NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false) progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - - } + +} //---------------------------------------------------- // MARK: - Molecule //------------------------------------------------------ - override open func reset() { - super.reset() - progressBar.reset() - leftLabel.reset() - rightLabel.reset() - - } public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.setWithModel(model, delegateObject, additionalData) @@ -83,5 +66,13 @@ import UIKit public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 90 } + + + override open func reset() { + super.reset() + progressBar.reset() + leftLabel.styleB1(true) + rightLabel.styleB1(true) + } } From 3734cae058ae90caaa28dfb4207cafd099b1e57e Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Wed, 26 Feb 2020 21:24:43 +0530 Subject: [PATCH 05/10] Code improvement. --- .../LeftVariable/ListProgressBarData.swift | 40 +++++-------------- .../ListProgressBarDataModel.swift | 8 +--- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift index 466439a1..8f43369b 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift @@ -6,7 +6,6 @@ // Copyright © 2020 Verizon Wireless. All rights reserved. // -import Foundation import UIKit @objcMembers public class ListProgressBarData: TableViewCell { @@ -23,39 +22,23 @@ import UIKit //----------------------------------------------------- // MARK: - View Lifecycle //----------------------------------------------------- - - open override func updateView(_ size: CGFloat) { - super.updateView(size) - progressBar.updateView(size) - leftLabel.updateView(size) - rightLabel.updateView(size) - - } - override open func setupView() { super.setupView() - - contentView.addSubview(view) + + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) view.addSubview(progressBar) view.addSubview(leftLabel) view.addSubview(rightLabel) - containerHelper.constrainView(view) - - //constraints - + addMolecule(view) NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false) progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true - progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - -} + view.bottomAnchor.constraint(equalTo: progressBar.bottomAnchor).isActive = true + } - //---------------------------------------------------- - // MARK: - Molecule - //------------------------------------------------------ - - public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + // MARK: - MVMCoreUIMoleculeViewProtocol + open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.setWithModel(model, delegateObject, additionalData) guard let model = model as? ListProgressBarDataModel else { return} progressBar.setWithModel(model.progressBar, delegateObject, additionalData) @@ -63,16 +46,15 @@ import UIKit rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) } - public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 90 - } - - override open func reset() { super.reset() progressBar.reset() leftLabel.styleB1(true) rightLabel.styleB1(true) } + + open override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift index b7917739..de6ada2e 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift @@ -10,15 +10,10 @@ import Foundation public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { public static var identifier: String = "listPrgBarData" - public var progressBar : MultiProgressBarModel public var leftLabel: LabelModel public var rightLabel: LabelModel - - override public func setDefaults() { - super.setDefaults() - } - + public init (progressBar: MultiProgressBarModel, leftLabel: LabelModel, rightLabel: LabelModel){ self.progressBar = progressBar self.leftLabel = leftLabel @@ -48,6 +43,5 @@ public class ListProgressBarDataModel : ListItemModel, MoleculeModelProtocol { try container.encode(progressBar, forKey: .progressBar) try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) - } } From ff0fb6b7cd4c962d4992152c520c8173b672a986 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 27 Feb 2020 20:38:57 +0530 Subject: [PATCH 06/10] Added files to LockUps and constraint changes. --- MVMCoreUI.xcodeproj/project.pbxproj | 12 ++++++++++-- .../ListProgressBarData.swift | 6 ++++-- .../ListProgressBarDataModel.swift | 0 3 files changed, 14 insertions(+), 4 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{List/LeftVariable => LockUps}/ListProgressBarData.swift (93%) rename MVMCoreUI/Molecules/DesignedComponents/{List/LeftVariable => LockUps}/ListProgressBarDataModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 0fc24c53..56b0c33f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -785,6 +785,15 @@ path = OneColumn; sourceTree = ""; }; + 525239C32407FFCC00454969 /* LockUps */ = { + isa = PBXGroup; + children = ( + 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, + 525019DC2406430800EED91C /* ListProgressBarData.swift */, + ); + path = LockUps; + sourceTree = ""; + }; 946EE1B5237B663A0036751F /* Extensions */ = { isa = PBXGroup; children = ( @@ -999,6 +1008,7 @@ D22B38E923F4E07800490EF6 /* DesignedComponents */ = { isa = PBXGroup; children = ( + 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, ); @@ -1017,8 +1027,6 @@ D22B38EB23F4E0AE00490EF6 /* LeftVariable */ = { isa = PBXGroup; children = ( - 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, - 525019DC2406430800EED91C /* ListProgressBarData.swift */, 522679C023FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift */, 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */, 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift similarity index 93% rename from MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift rename to MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift index 8f43369b..cb6beb01 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift @@ -8,7 +8,7 @@ import UIKit -@objcMembers public class ListProgressBarData: TableViewCell { +@objcMembers open class ListProgressBarData: TableViewCell { //----------------------------------------------------- // MARK: - Outlets @@ -33,7 +33,7 @@ import UIKit NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false) progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true + progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: 8).isActive = true view.bottomAnchor.constraint(equalTo: progressBar.bottomAnchor).isActive = true } @@ -49,6 +49,8 @@ import UIKit override open func reset() { super.reset() progressBar.reset() + leftLabel.reset() + rightLabel.reset() leftLabel.styleB1(true) rightLabel.styleB1(true) } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarDataModel.swift similarity index 100% rename from MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarDataModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarDataModel.swift From 6b93270431957c4a48aaa34438e5dbf9a45c1b3b Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 2 Mar 2020 10:59:24 -0500 Subject: [PATCH 07/10] opening access to prevent error --- ...VariableCheckboxAllTextAndLinksModel.swift | 22 ++++++++++++--- MVMCoreUI/Molecules/Items/ListItemModel.swift | 27 ++++++++++++++++--- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift index 188af025..d3d3aab4 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift @@ -9,32 +9,48 @@ import Foundation open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + open class var identifier: String { return "listLVCB" } public var checkbox: CheckboxModel public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(checkbox: CheckboxModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) { self.checkbox = checkbox self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink super.init() } + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { case moleculeName case eyebrowHeadlineBodyLink case checkbox } - + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink) checkbox = try typeContainer.decodeIfPresent(CheckboxModel.self, forKey: .checkbox) ?? CheckboxModel() try super.init(from: decoder) } - - public override func encode(to encoder: Encoder) throws { + + open 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) diff --git a/MVMCoreUI/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Molecules/Items/ListItemModel.swift index 4e0ccd35..3ff483eb 100644 --- a/MVMCoreUI/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/ListItemModel.swift @@ -10,12 +10,20 @@ import Foundation @objcMembers open class ListItemModel: ContainerModel, ListItemModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public var backgroundColor: Color? public var action: ActionModelProtocol? public var hideArrow: Bool? public var line: LineModel? public var style: String? - + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { case backgroundColor case action @@ -24,6 +32,10 @@ import Foundation case style } + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + /// Defaults to set open func setDefaults() { if useHorizontalMargins == nil { @@ -37,11 +49,19 @@ import Foundation } } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public override init() { super.init() setDefaults() } - + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) @@ -52,7 +72,7 @@ import Foundation try super.init(from: decoder) setDefaults() } - + open override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) @@ -63,4 +83,3 @@ import Foundation try container.encodeIfPresent(style, forKey: .style) } } - From d04e87edafc71cba73f3b53ebee7b63e51e30b10 Mon Sep 17 00:00:00 2001 From: "Robinson, Blake" Date: Tue, 3 Mar 2020 15:37:58 -0500 Subject: [PATCH 08/10] Helps resolve CXTDT-63501 Gesture recognizer on Page Control needs to be public so that subclass, MFTextPageControl, can add it and remove it as needed --- MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h | 1 + MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m | 1 + 2 files changed, 2 insertions(+) diff --git a/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h index af699ddc..e86d3f9e 100644 --- a/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h +++ b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h @@ -23,6 +23,7 @@ @property (nullable, weak, nonatomic) UIView *containerView; @property (nullable, weak, nonatomic) UIView *indicatorRectangle; @property (nullable, copy, nonatomic) PagingTouchBlock pagingTouchBlock; +@property (nullable, strong, nonatomic) UITapGestureRecognizer *tapGestureRecognizer; ///set YES to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is NO @property (nonatomic) BOOL isSlidesAcc; diff --git a/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m index 6648b513..9a8f880f 100644 --- a/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m +++ b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m @@ -267,6 +267,7 @@ static CGFloat const IndicatorRectangleHeight = 4; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] init]; [tapGesture addTarget:self action:@selector(rectangleTapped:)]; [self addGestureRecognizer:tapGesture]; + self.tapGestureRecognizer = tapGesture; } } From 61fea9ae8a131aab28e70230e1816ac14f0bc999 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 3 Mar 2020 15:58:26 -0500 Subject: [PATCH 09/10] Remove right panel protocol --- .../MVMCoreUISplitViewController.h | 14 +++----- .../MVMCoreUISplitViewController.m | 33 ++++++++----------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h index 1a72a190..2c82fe21 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h @@ -50,11 +50,14 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { // Convenience getter + (nullable instancetype)mainSplitViewController; +/// Initializes the splitviewcontroller with the passed in panels. +- (nullable instancetype)initWithLeftPanel:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel; + // Returns a split controller with the mvm styling. Also sets the appropriate handlers. -+ (nullable instancetype)setup; ++ (nullable instancetype)setup:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel; // Returns a split controller with the mvm styling. Also sets the appropriate handlers. Also sets up the default load screen -+ (nullable instancetype)setupAsMainController; ++ (nullable instancetype)setupAsMainController:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel; #pragma mark - Panel Functions @@ -83,9 +86,6 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { // contains speicaly logic to set the icon color - (void)setNavigationIconColor:(nullable UIColor *)color; -///create right and left panel. if left and right panel is already created, will replace them -- (void)createPanels; - /// Updates the panels that are used. - (void)setupPanels; @@ -123,10 +123,6 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { // Can subclass to set threshold for when the drawers are permanently extended. Default is 1000 for the left panel and 2000 for both. - (MFNumberOfDrawers)numberOfDrawersShouldShow:(nullable NSNumber *)forWidth; -// subclass to return default global panels. kept alive after creation. -- (nullable UIViewController *)createLeftPanelViewController; -- (nullable UIViewController *)createRightPanelViewController; - // subclass to change image of back button - (nullable UIImage *)imageForBackButton; diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 93aeb6fd..44642f3a 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -76,18 +76,26 @@ CGFloat const PanelAnimationDuration = 0.2; return [MVMCoreActionUtility initializerClassCheck:[MVMCoreUISession sharedGlobal].splitViewController classToVerify:self]; } -+ (nullable instancetype)setup { - MVMCoreUISplitViewController *splitViewController = [[self alloc] init]; ++ (nullable instancetype)setup:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel { + MVMCoreUISplitViewController *splitViewController = [[self alloc] initWithLeftPanel:leftPanel rightPanel:rightPanel]; [MVMCoreUISession sharedGlobal].splitViewController = splitViewController; return splitViewController; } -+ (nullable instancetype)setupAsMainController { - MVMCoreUISplitViewController *splitViewController = [self setup]; ++ (nullable instancetype)setupAsMainController:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel { + MVMCoreUISplitViewController *splitViewController = [self setup:leftPanel rightPanel:rightPanel]; [[MVMCoreUISession sharedGlobal] setupAsStandardLoadViewDelegate:splitViewController]; return splitViewController; } +- (nullable instancetype)initWithLeftPanel:(nullable UIViewController *)leftPanel rightPanel:(nullable UIViewController *)rightPanel { + if (self = [super init]) { + self.globalLeftPanel = leftPanel; + self.globalRightPanel = rightPanel; + } + return self; +} + #pragma mark - Main Subclassables - (MFNumberOfDrawers)numberOfDrawersShouldShow:(NSNumber *)forWidth { @@ -100,14 +108,6 @@ CGFloat const PanelAnimationDuration = 0.2; return (width > 2000 ? MFTwoDrawer : (width > 1000 ? MFOneDrawer : MFNoDrawer)); } -- (nullable UIViewController *)createLeftPanelViewController { - return nil; -} - -- (nullable UIViewController *)createRightPanelViewController { - return nil; -} - - (nullable NSArray *)additionalLeftButtons { return nil; } @@ -766,13 +766,6 @@ CGFloat const PanelAnimationDuration = 0.2; } } -- (void)createPanels { - // Create panels - self.globalLeftPanel = [self createLeftPanelViewController]; - self.globalRightPanel = [self createRightPanelViewController]; - [self setupPanels]; -} - - (void)setupPanels { [self forceHideBothDrawers]; [self setupLeftPanel]; @@ -869,7 +862,7 @@ CGFloat const PanelAnimationDuration = 0.2; [NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES; [NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES; - [self createPanels]; + [self setupPanels]; } - (void)viewDidLoad { From 1e0300914296f3213153152fc5f0a1f5283e0018 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 4 Mar 2020 09:15:57 -0500 Subject: [PATCH 10/10] slight cleanup --- .../LockUps/ListProgressBarData.swift | 53 +++++++++++-------- .../ListFourColumnDataUsageDivider.swift | 10 ++-- .../ListThreeColumnPlanDataDivider.swift | 2 +- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift index cb6beb01..48f734ad 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift @@ -13,14 +13,13 @@ import UIKit //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - let progressBar = MultiProgress(frame: .zero) - let leftLabel = Label.commonLabelB1(true) - let rightLabel = Label.commonLabelB1(true) - let view = View() + let leftLabel = Label.createLabelBoldBodySmall(true) + let rightLabel = Label.createLabelBoldBodySmall(true) + let view = MVMCoreUICommonViewsUtility.commonView() //----------------------------------------------------- - // MARK: - View Lifecycle + // MARK: - MFViewProtocol //----------------------------------------------------- override open func setupView() { super.setupView() @@ -29,34 +28,46 @@ import UIKit view.addSubview(progressBar) view.addSubview(leftLabel) view.addSubview(rightLabel) - addMolecule(view) - NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false) + contentView.addSubview(view) + containerHelper.constrainView(view) + NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: true, bottomAnchor: progressBar.topAnchor, constant: 8) progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: 8).isActive = true view.bottomAnchor.constraint(equalTo: progressBar.bottomAnchor).isActive = true } - // MARK: - MVMCoreUIMoleculeViewProtocol - open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { - super.setWithModel(model, delegateObject, additionalData) - guard let model = model as? ListProgressBarDataModel else { return} - progressBar.setWithModel(model.progressBar, delegateObject, additionalData) - leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) - rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) + public override func updateView(_ size: CGFloat) { + super.updateView(size) + progressBar.updateView(size) + leftLabel.updateView(size) + rightLabel.updateView(size) } + //----------------------------------------------------- + // 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? ListProgressBarDataModel else { return} + progressBar.set(with: model.progressBar, delegateObject, additionalData) + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + //----------------------------------------------------- + // MARK: - MVMCoreUIMoleculeViewProtocol + //----------------------------------------------------- override open func reset() { super.reset() progressBar.reset() leftLabel.reset() rightLabel.reset() - leftLabel.styleB1(true) - rightLabel.styleB1(true) - } - - open override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 90 + leftLabel.styleBoldBodySmall(true) + rightLabel.styleBoldBodySmall(true) } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift index 35968599..8e37c16a 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift @@ -38,7 +38,7 @@ import Foundation stack.restack() } - // MARK: - MVMCoreUIMoleculeViewProtocol + // 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? ListFourColumnDataUsageDividerModel else { return } @@ -48,6 +48,10 @@ import Foundation label4.set(with: model.label4, delegateObject, additionalData) } + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 121 + } + // MARK: - MVMCoreUIMoleculeViewProtocol open override func reset() { super.reset() @@ -56,8 +60,4 @@ import Foundation label3.styleBoldBodySmall(true) label4.styleBoldBodySmall(true) } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { - return 121 - } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDivider.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDivider.swift index 9adbe531..cc904a77 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDivider.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDivider.swift @@ -35,7 +35,7 @@ import Foundation stack.restack() } - // MARK: - MVMCoreUIMoleculeViewProtocol + // 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? ListThreeColumnPlanDataDividerModel else { return }