From a59560e37bee5760f54de542432aa5ef8302fd06 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 May 2022 12:11:32 -0500 Subject: [PATCH 01/14] updated models for use of Decoder Context Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift | 5 +++++ .../TwoButtonViewModel.swift | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift index 3b72d37c..5bff2a39 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift @@ -198,6 +198,11 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat title = try typeContainer.decode(String.self, forKey: .title) action = try typeContainer.decodeModel(codingKey: .action) + if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style{ + self.style = style + setFacade(by: style) + } + if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) { self.style = style setFacade(by: style) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TwoButtonViewModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TwoButtonViewModel.swift index 4d843e6a..718cfc30 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TwoButtonViewModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TwoButtonViewModel.swift @@ -50,13 +50,17 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol { required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) - primaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .primaryButton) - if primaryButton?.style == nil { - primaryButton?.style = .primary + + //set context value for 'primary' style to be set for the primaryButton in case the + //property is not returned in the JSON and once decoded, this value is removed from the context + try decoder.setContext(value: Styler.Button.Style.primary, for: "style") { + self.primaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .primaryButton) } - secondaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .secondaryButton) - if secondaryButton?.style == nil { - secondaryButton?.style = .secondary + + //set context value for 'secondary' style to be set for the primaryButton in case the + //property is not returned in the JSON and once decoded, this value is removed from the context + try decoder.setContext(value: Styler.Button.Style.secondary, for: "style") { + self.secondaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .secondaryButton) } } From 33100758b8af9f26951b25c9f2b1e7456abce747 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 May 2022 12:11:48 -0500 Subject: [PATCH 02/14] udpated constructors for JSONDecoder Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift | 6 +----- MVMCoreUI/TopAlert/TopNotificationModel.swift | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift index 06660715..4fdff197 100644 --- a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift @@ -33,11 +33,7 @@ public extension TemplateProtocol { guard let pageJSON = json else { return } let delegateObject = (self as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject let data = try JSONSerialization.data(withJSONObject: pageJSON) - let decoder = JSONDecoder() - if let delegateObject = delegateObject { - // Add the delegate to access mid parsing if applicable. - try decoder.add(delegateObject: delegateObject) - } + let decoder = try JSONDecoder.create(delegateObject: delegateObjectIVar) templateModel = try decodeTemplate(using: decoder, from: data) // Add additional required behaviors if applicable. diff --git a/MVMCoreUI/TopAlert/TopNotificationModel.swift b/MVMCoreUI/TopAlert/TopNotificationModel.swift index 7c07c980..7d19bfcf 100644 --- a/MVMCoreUI/TopAlert/TopNotificationModel.swift +++ b/MVMCoreUI/TopAlert/TopNotificationModel.swift @@ -69,10 +69,7 @@ open class TopNotificationModel: Codable { /// Decodes the top alert json to a model. public static func decode(json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) throws -> Self { let data = try JSONSerialization.data(withJSONObject: json) - let decoder = JSONDecoder() - if let delegateObject = delegateObject { - try decoder.add(delegateObject: delegateObject) - } + let decoder = try JSONDecoder.create(delegateObject: delegateObject) return try decoder.decode(self, from: data) } From c5281fa39070b50f53266bac6d621ec12f15a1cf Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 May 2022 12:14:13 -0500 Subject: [PATCH 03/14] fixed bug Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift index 4fdff197..91acdb77 100644 --- a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift @@ -33,7 +33,7 @@ public extension TemplateProtocol { guard let pageJSON = json else { return } let delegateObject = (self as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject let data = try JSONSerialization.data(withJSONObject: pageJSON) - let decoder = try JSONDecoder.create(delegateObject: delegateObjectIVar) + let decoder = try JSONDecoder.create(delegateObject: delegateObject) templateModel = try decodeTemplate(using: decoder, from: data) // Add additional required behaviors if applicable. From 42c203e77366c25f2612707206aa89c5f3e46f3a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 May 2022 12:16:47 -0500 Subject: [PATCH 04/14] removed try Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift | 2 +- MVMCoreUI/TopAlert/TopNotificationModel.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift index 91acdb77..0df77ff1 100644 --- a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift @@ -33,7 +33,7 @@ public extension TemplateProtocol { guard let pageJSON = json else { return } let delegateObject = (self as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject let data = try JSONSerialization.data(withJSONObject: pageJSON) - let decoder = try JSONDecoder.create(delegateObject: delegateObject) + let decoder = JSONDecoder.create(delegateObject: delegateObject) templateModel = try decodeTemplate(using: decoder, from: data) // Add additional required behaviors if applicable. diff --git a/MVMCoreUI/TopAlert/TopNotificationModel.swift b/MVMCoreUI/TopAlert/TopNotificationModel.swift index 7d19bfcf..8e885e22 100644 --- a/MVMCoreUI/TopAlert/TopNotificationModel.swift +++ b/MVMCoreUI/TopAlert/TopNotificationModel.swift @@ -69,7 +69,7 @@ open class TopNotificationModel: Codable { /// Decodes the top alert json to a model. public static func decode(json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) throws -> Self { let data = try JSONSerialization.data(withJSONObject: json) - let decoder = try JSONDecoder.create(delegateObject: delegateObject) + let decoder = JSONDecoder.create(delegateObject: delegateObject) return try decoder.decode(self, from: data) } From d879b8c71f4bde21db47c45bfd682f5c8e5382bd Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 May 2022 14:50:27 -0500 Subject: [PATCH 05/14] refactored create(with: Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift | 2 +- MVMCoreUI/TopAlert/TopNotificationModel.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift index 0df77ff1..082f2da3 100644 --- a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift @@ -33,7 +33,7 @@ public extension TemplateProtocol { guard let pageJSON = json else { return } let delegateObject = (self as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject let data = try JSONSerialization.data(withJSONObject: pageJSON) - let decoder = JSONDecoder.create(delegateObject: delegateObject) + let decoder = JSONDecoder.create(with: delegateObject) templateModel = try decodeTemplate(using: decoder, from: data) // Add additional required behaviors if applicable. diff --git a/MVMCoreUI/TopAlert/TopNotificationModel.swift b/MVMCoreUI/TopAlert/TopNotificationModel.swift index 8e885e22..75300a3f 100644 --- a/MVMCoreUI/TopAlert/TopNotificationModel.swift +++ b/MVMCoreUI/TopAlert/TopNotificationModel.swift @@ -69,7 +69,7 @@ open class TopNotificationModel: Codable { /// Decodes the top alert json to a model. public static func decode(json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) throws -> Self { let data = try JSONSerialization.data(withJSONObject: json) - let decoder = JSONDecoder.create(delegateObject: delegateObject) + let decoder = JSONDecoder.create(with: delegateObject) return try decoder.decode(self, from: data) } From eaf4bbe116653b6b8c6e8c4c6b1097e92abb0b9b Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 19 May 2022 13:21:27 -0400 Subject: [PATCH 06/14] background color, bridge mf view controller new data, optional delegate --- MVMCoreUI/Behaviors/AddRemoveMoleculeBehavior.swift | 2 +- MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Behaviors/AddRemoveMoleculeBehavior.swift b/MVMCoreUI/Behaviors/AddRemoveMoleculeBehavior.swift index ee4d9587..a3be96f5 100644 --- a/MVMCoreUI/Behaviors/AddRemoveMoleculeBehavior.swift +++ b/MVMCoreUI/Behaviors/AddRemoveMoleculeBehavior.swift @@ -75,7 +75,7 @@ public class AddRemoveMoleculesBehavior: PageCustomActionHandlerBehavior, PageMo self.delegate = delegateObject } - public func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject) { + public func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) { guard let list = delegate?.moleculeListDelegate else { return } for case let model as (MoleculeModelProtocol & ListItemModelProtocol & AddMolecules) in rootMolecules { if let moleculesToAdd = model.getRecursiveMoleculesToAdd(), diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift index 76bc7f84..eadd5e4e 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift @@ -19,7 +19,7 @@ public protocol PageBehaviorProtocol: ModelHandlerProtocol { public protocol PageMoleculeTransformationBehavior: PageBehaviorProtocol { - func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject) + func onPageNew(rootMolecules: [MoleculeModelProtocol], _ delegateObject: MVMCoreUIDelegateObject?) } public protocol PageVisibilityBehavior: PageBehaviorProtocol { From 6ad5ebbf92d7c2d4c6d6d8e955af1ab3bf6509ac Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 19 May 2022 17:41:35 -0400 Subject: [PATCH 07/14] 3.0 font updates --- .../Atomic/Molecules/HorizontalCombinationViews/TabBar.swift | 4 ++-- .../UINavigationController+Extension.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift index e7096069..527ed054 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift @@ -58,11 +58,11 @@ import VDSColorTokens /// Sets the item colors. private func set(tabItemAppearance: UITabBarItemAppearance, model: TabBarModel) { tabItemAppearance.normal.iconColor = model.unSelectedColor.uiColor - tabItemAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: model.unSelectedColor.uiColor, NSAttributedString.Key.font: MFFonts.mfFontTXRegular(10)] + tabItemAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: model.unSelectedColor.uiColor, NSAttributedString.Key.font: MFFonts.mfFontTXBold(10)] tabItemAppearance.normal.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -3) tabItemAppearance.selected.iconColor = model.selectedColor.uiColor - tabItemAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: model.selectedColor.uiColor, NSAttributedString.Key.font: MFFonts.mfFontTXRegular(10)] + tabItemAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: model.selectedColor.uiColor, NSAttributedString.Key.font: MFFonts.mfFontTXBold(10)] tabItemAppearance.selected.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -3) } diff --git a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift index ea5003f4..b88e11ba 100644 --- a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift +++ b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift @@ -66,7 +66,7 @@ public extension UINavigationController { /// Convenience function for setting the navigation bar ui func setNavigationBarUI(with model: NavigationItemModelProtocol) { let navigationBar = navigationBar - let font = MFStyler.fontBoldBodySmall(false) + let font = MFStyler.fontRegularBodyLarge(false) let backgroundColor = model.backgroundColor?.uiColor let tint = model.tintColor.uiColor navigationBar.tintColor = tint From 4dc5ee5e6aa631a21b82c1979e89d1f411c70c6b Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 19 May 2022 17:59:42 -0400 Subject: [PATCH 08/14] bold --- .../NavigationController/UINavigationController+Extension.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift index b88e11ba..e1c7f6a3 100644 --- a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift +++ b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift @@ -66,7 +66,7 @@ public extension UINavigationController { /// Convenience function for setting the navigation bar ui func setNavigationBarUI(with model: NavigationItemModelProtocol) { let navigationBar = navigationBar - let font = MFStyler.fontRegularBodyLarge(false) + let font = MFStyler.fontBoldBodyLarge(false) let backgroundColor = model.backgroundColor?.uiColor let tint = model.tintColor.uiColor navigationBar.tintColor = tint From 19ef7a3a26aa337ea9e17f3b695703079cefb6a8 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 27 May 2022 00:18:18 +0530 Subject: [PATCH 09/14] Fix for CXTDT-288387, removing line molecule from Tab --- .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 6 ------ MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 1 - 2 files changed, 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 4e424549..e78ccf19 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -28,7 +28,6 @@ import VDSColorTokens let bottomScrollView = UIScrollView(frame: .zero) let bottomContentView = View() - let bottomLine = Line() let selectionLine = View() var selectionLineLeftConstraint: NSLayoutConstraint? var selectionLineWidthConstraint: NSLayoutConstraint? @@ -68,7 +67,6 @@ import VDSColorTokens open override func setupView() { super.setupView() backgroundColor = VDSColor.backgroundPrimaryLight - addSubview(bottomLine) setupCollectionView() setupSelectionLine() setupConstraints() @@ -116,10 +114,6 @@ import VDSColorTokens selectionLineWidthConstraint = selectionLine.widthAnchor.constraint(equalToConstant: minimumItemWidth) selectionLineWidthConstraint?.isActive = true NSLayoutConstraint.constraintPinSubview(toSuperview: bottomContentView) - - //bottom line - bottomLine.topAnchor.constraint(equalTo: bottomScrollView.bottomAnchor).isActive = true; - NSLayoutConstraint.constraintPinSubview(bottomLine, pinTop: false, pinBottom: true, pinLeft: true, pinRight: true) } //------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index d3b91b11..5fe9c530 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -22,7 +22,6 @@ import UIKit tabs.paddingBeforeFirstTab = false tabs.translatesAutoresizingMaskIntoConstraints = false tabs.delegate = self - tabs.bottomLine.setStyle(.none) contentView.addSubview(tabs) NSLayoutConstraint.activate(Array(NSLayoutConstraint.pinView(toSuperview: tabs, useMargins: true).values)) From eeb6573e727eae09b6a6df3eefef6d5901c021ad Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 27 May 2022 12:13:06 +0530 Subject: [PATCH 10/14] Reverting - line changes in Tab component & Removing line item in Subnavigation controller --- .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 7 +++++++ MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 1 + MVMCoreUI/Managers/SubNav/SubNavManagerController.swift | 6 +----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index e78ccf19..f6f834ca 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -28,6 +28,7 @@ import VDSColorTokens let bottomScrollView = UIScrollView(frame: .zero) let bottomContentView = View() + let bottomLine = Line() let selectionLine = View() var selectionLineLeftConstraint: NSLayoutConstraint? var selectionLineWidthConstraint: NSLayoutConstraint? @@ -67,6 +68,8 @@ import VDSColorTokens open override func setupView() { super.setupView() backgroundColor = VDSColor.backgroundPrimaryLight + bottomLine.setStyle(.secondary) + addSubview(bottomLine) setupCollectionView() setupSelectionLine() setupConstraints() @@ -114,6 +117,10 @@ import VDSColorTokens selectionLineWidthConstraint = selectionLine.widthAnchor.constraint(equalToConstant: minimumItemWidth) selectionLineWidthConstraint?.isActive = true NSLayoutConstraint.constraintPinSubview(toSuperview: bottomContentView) + + //bottom line + bottomLine.topAnchor.constraint(equalTo: bottomScrollView.bottomAnchor).isActive = true; + NSLayoutConstraint.constraintPinSubview(bottomLine, pinTop: false, pinBottom: true, pinLeft: true, pinRight: true) } //------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index 5fe9c530..0ecb230f 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -22,6 +22,7 @@ import UIKit tabs.paddingBeforeFirstTab = false tabs.translatesAutoresizingMaskIntoConstraints = false tabs.delegate = self + tabs.bottomLine.setStyle(.secondary) contentView.addSubview(tabs) NSLayoutConstraint.activate(Array(NSLayoutConstraint.pinView(toSuperview: tabs, useMargins: true).values)) diff --git a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift index b3a142ba..f5c4023a 100644 --- a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift +++ b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift @@ -19,7 +19,7 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol, /// Used to layout the ui. public lazy var stackView: UIStackView = { - let stackView = UIStackView(arrangedSubviews: [tabs, line, subNavigationController.view]) + let stackView = UIStackView(arrangedSubviews: [tabs, subNavigationController.view]) stackView.translatesAutoresizingMaskIntoConstraints = false stackView.isAccessibilityElement = false stackView.axis = .vertical @@ -33,10 +33,6 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol, return tabs }() - public lazy var line: Line = { - return Line(model: LineModel(type: .secondary), delegateObjectIVar, nil) - }() - public lazy var subNavigationController: UINavigationController = { let subNavigationController = SubNavManagerNavigationController(rootViewController: viewController) subNavigationController.view.translatesAutoresizingMaskIntoConstraints = false From 4cf9f6128203313d5566633eb0f4a32eeb39b6cd Mon Sep 17 00:00:00 2001 From: Naresh Reddy Maram Reddy Date: Fri, 27 May 2022 12:17:46 +0530 Subject: [PATCH 11/14] Removed preferredControlTintColor & preferredBarTintColor for SFSafariViewControllers to use default. --- MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m b/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m index fb7fe919..9425547c 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m @@ -125,8 +125,6 @@ - (void)openURLInSafariWebView:(nonnull NSURL *)url { SFSafariViewController *safariViewController = [[SFSafariViewController alloc] initWithURL:url]; - safariViewController.preferredBarTintColor = [UIColor whiteColor]; - safariViewController.preferredControlTintColor = [UIColor blackColor]; [[MVMCoreNavigationHandler sharedNavigationHandler] presentViewController:safariViewController animated:YES]; } From 7fbac6b8dcef2edc7427044534503c4dc8118f41 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 27 May 2022 20:25:47 +0530 Subject: [PATCH 12/14] Changes to set the line style after initialization --- MVMCoreUI/Atomic/Atoms/Views/Line.swift | 3 +++ .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Line.swift b/MVMCoreUI/Atomic/Atoms/Views/Line.swift index d4c4d26d..e36c8d23 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Line.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Line.swift @@ -49,16 +49,19 @@ import UIKit public init() { super.init(frame: .zero) model = LineModel(type: .secondary) + setStyle(.secondary) } public override init(frame: CGRect) { super.init(frame: frame) model = LineModel(type: .secondary) + setStyle(.secondary) } public required init?(coder: NSCoder) { super.init(coder: coder) model = LineModel(type: .secondary) + setStyle(.secondary) } public required init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index f6f834ca..4e424549 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -68,7 +68,6 @@ import VDSColorTokens open override func setupView() { super.setupView() backgroundColor = VDSColor.backgroundPrimaryLight - bottomLine.setStyle(.secondary) addSubview(bottomLine) setupCollectionView() setupSelectionLine() From 3e8f464aac5322b805712e7a779809654c43f25b Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 27 May 2022 21:10:41 +0530 Subject: [PATCH 13/14] Reverting line changes in TabTableCell --- MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index 0ecb230f..d3b91b11 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -22,7 +22,7 @@ import UIKit tabs.paddingBeforeFirstTab = false tabs.translatesAutoresizingMaskIntoConstraints = false tabs.delegate = self - tabs.bottomLine.setStyle(.secondary) + tabs.bottomLine.setStyle(.none) contentView.addSubview(tabs) NSLayoutConstraint.activate(Array(NSLayoutConstraint.pinView(toSuperview: tabs, useMargins: true).values)) From 4645e0de976a86eb9d610331d4419fb76a306572 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 9 Jun 2022 18:17:29 -0400 Subject: [PATCH 14/14] default the title offset for all inits --- .../Molecules/NavigationBar/NavigationItemModel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index 523f6ea1..64b61480 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -61,7 +61,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc open var additionalLeftButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? open var additionalRightButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? open var titleView: MoleculeModelProtocol? - open var titleOffset: UIOffset? + open var titleOffset: UIOffset? = UIOffset(horizontal: -CGFloat.greatestFiniteMagnitude, vertical: 0) //-------------------------------------------------- // MARK: - Initializer @@ -114,7 +114,9 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc additionalRightButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalRightButtons) titleView = try typeContainer.decodeModelIfPresent(codingKey: .titleView) style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) - titleOffset = try typeContainer.decodeIfPresent(UIOffset.self, forKey: .titleOffset) ?? UIOffset(horizontal: -CGFloat.greatestFiniteMagnitude, vertical: 0) + if let titleOffset = try typeContainer.decodeIfPresent(UIOffset.self, forKey: .titleOffset) { + self.titleOffset = titleOffset + } line?.inverted = style == .dark }