From 5a4aeb0a4e48aa0d0e3fd8c13d05ade69246a4f7 Mon Sep 17 00:00:00 2001 From: Damodaram Date: Mon, 18 Jan 2021 13:46:46 +0530 Subject: [PATCH 01/13] increased spacing --- .../VerticalCombinationViews/EyebrowHeadlineBodyLink.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index ca76f0fb..55055e94 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -29,7 +29,7 @@ open override func setupView() { super.setupView() stack.setAndCreateModel(with: [eyebrow, headline, body, link]) - stack.stackModel?.spacing = 0 + stack.stackModel?.spacing = 2.0 addSubview(stack) NSLayoutConstraint.constraintPinSubview(toSuperview: stack) stack.restack() From 724763d50c6c49f0c019c968985adfa26eed63c1 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 10 Mar 2021 17:20:06 +0530 Subject: [PATCH 02/13] Added moleculename for encoding. --- .../Item Dropdown/MultiItemDropdownEntryFieldModel.swift | 2 ++ .../Atoms/FormFields/TextFields/TextEntryFieldModel.swift | 2 ++ MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift | 2 ++ .../Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift | 2 ++ 4 files changed, 8 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift index 8799f6aa..2f645552 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift @@ -86,6 +86,7 @@ import Foundation //-------------------------------------------------- private enum CodingKeys: String, CodingKey { + case moleculeName case components case selectedIndexes case delimiters @@ -119,6 +120,7 @@ import Foundation 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(components, forKey: .components) try container.encode(selectedIndexesArray, forKey: .selectedIndexes) try container.encodeIfPresent(delimiterArray, forKey: .delimiters) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift index ca7543bd..66b3d4bf 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift @@ -95,6 +95,7 @@ //-------------------------------------------------- private enum CodingKeys: String, CodingKey { + case moleculeName case placeholder case textAlignment case enabledTextColor @@ -140,6 +141,7 @@ 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.encodeIfPresent(placeholder, forKey: .placeholder) try container.encodeIfPresent(textAlignment, forKey: .textAlignment) try container.encodeIfPresent(type, forKey: .type) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index 19348070..018a93d6 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -30,6 +30,7 @@ import Foundation //-------------------------------------------------- private enum CodingKeys: String, CodingKey { + case moleculeName case peakingUI case peakingArrowColor case analyticsData @@ -52,6 +53,7 @@ import Foundation 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) try container.encodeIfPresent(peakingUI, forKey: .peakingUI) try container.encodeIfPresent(peakingArrowColor, forKey: .peakingArrowColor) try container.encodeIfPresent(analyticsData, forKey: .analyticsData) diff --git a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift index 56b77e3e..467ae6ac 100644 --- a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift +++ b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift @@ -36,6 +36,7 @@ open class BGImageMoleculeModel: MoleculeContainerModel { } private enum CodingKeys: String, CodingKey { + case moleculeName case image } @@ -53,6 +54,7 @@ open class BGImageMoleculeModel: MoleculeContainerModel { 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) try container.encode(image, forKey: .image) } } From 537da03d2c334974523aa0801f238a0e83db6dcd Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 15 Mar 2021 16:37:32 -0500 Subject: [PATCH 03/13] refactored to use the new handler registration in ModelRestry Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 11 ++++------- MVMCoreUI/Atomic/Organisms/Stack.swift | 2 +- MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 3dfed18d..f868169d 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -9,9 +9,6 @@ import Foundation @objcMembers public class MoleculeObjectMapping: NSObject { - - public var moleculeMapping: [String: MoleculeViewProtocol.Type] = [:] - /// Returns the mapping object stored in the singleton public static func shared() -> Self? { return MVMCoreActionUtility.initializerClassCheck(CoreUIObject.sharedInstance()?.moleculeMap, classToVerify: self) as? Self @@ -19,18 +16,17 @@ import Foundation /// Registers the model with the model registry and the view with the mapper. public func register(viewClass: V.Type, viewModelClass: M.Type) { - try? ModelRegistry.register(viewModelClass) - moleculeMapping.updateValue(viewClass, forKey: viewModelClass.identifier) + try? ModelRegistry.register(handler: viewClass, for: viewModelClass) } /// Returns the type of molecule view for the given model public func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? { - return moleculeMapping[model.moleculeName] + return ModelRegistry.getHandler(model) as? MoleculeViewProtocol.Type } /// Creates a molecule with the given model. public func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? { - guard let type = moleculeMapping[model.moleculeName] else { return nil } + guard let type = getMoleculeClass(model) else { return nil } return type.init(model: model, delegateObject, additionalData) } @@ -286,3 +282,4 @@ import Foundation } } } + diff --git a/MVMCoreUI/Atomic/Organisms/Stack.swift b/MVMCoreUI/Atomic/Organisms/Stack.swift index 29646f2e..e2772f5d 100644 --- a/MVMCoreUI/Atomic/Organisms/Stack.swift +++ b/MVMCoreUI/Atomic/Organisms/Stack.swift @@ -199,7 +199,7 @@ open class Stack: Container where T: (StackModelProtocol & MoleculeModelProto } var name = "stack<" for case let item in model.molecules { - if let moleculeClass = MoleculeObjectMapping.shared()?.moleculeMapping[item.moleculeName], + if let moleculeClass = MoleculeObjectMapping.shared()?.getMoleculeClass(item), let nameForReuse = moleculeClass.nameForReuse(with: item, delegateObject) { name.append(nameForReuse + ",") } else { diff --git a/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift b/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift index a8600c79..e4ebe78a 100644 --- a/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift @@ -9,7 +9,7 @@ import UIKit import MVMCore.MVMCoreViewProtocol -public protocol MoleculeViewProtocol: UIView { +public protocol MoleculeViewProtocol: UIView, ModelHandlerProtocol{ /// Initializes the view with the model init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) @@ -31,6 +31,7 @@ public protocol MoleculeViewProtocol: UIView { } extension MoleculeViewProtocol { + /// Calls set with model public init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { self.init(frame: .zero) From 431cf25faaf4f92983707f963a43ac762e04b5bf Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 16 Mar 2021 13:54:51 +0530 Subject: [PATCH 04/13] Added to avoid masked text being replaced with original text when view is reloaded. --- .../Atomic/Atoms/FormFields/TextFields/TextEntryField.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index 3d1b1534..2d9df0a7 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -366,6 +366,12 @@ import UIKit setupTextFieldToolbar() if isSelected { startEditing() } + + //Added to override text when view is reloaded. + if let text = textEntryFieldModel?.text, !text.isEmpty { + regexTextFieldOutputIfAvailable() + } + } } From 8ff11f914db0fcd7a9ec68307e28702605252e61 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 16 Mar 2021 21:42:50 +0530 Subject: [PATCH 05/13] Code changes as per review comment. --- .../Atomic/Atoms/FormFields/TextFields/TextEntryField.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index 2d9df0a7..1fa2140e 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -368,7 +368,7 @@ import UIKit if isSelected { startEditing() } //Added to override text when view is reloaded. - if let text = textEntryFieldModel?.text, !text.isEmpty { + if let text = model.text, !text.isEmpty { regexTextFieldOutputIfAvailable() } From 5e707d29a0bf0ef1502ecbd53157f1f9ed333cde Mon Sep 17 00:00:00 2001 From: Damodaram Date: Wed, 17 Mar 2021 12:02:48 +0530 Subject: [PATCH 06/13] updated spacing --- ...tLeftVariableIconWithRightCaretAllTextLinks.swift | 2 +- .../EyebrowHeadlineBodyLink.swift | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift index 93d1526f..fcd18f68 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift @@ -12,7 +12,7 @@ //-------------------------------------------------- public let leftImage = LoadImageView(pinnedEdges: .all) - public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() + public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(spacing: 2.0) public let rightLabel = Label(fontStyle: .RegularBodySmall) public lazy var rightLabelStackItem: StackItem = { diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 55055e94..a25426d7 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -22,6 +22,16 @@ get { return model as? EyebrowHeadlineBodyLinkModel } } + //-------------------------------------------------- + // MARK: - Initialization + //-------------------------------------------------- + + public convenience init(spacing: CGFloat) { + self.init(frame: .zero) + stack.stackModel?.spacing = spacing + stack.restack() + } + //-------------------------------------------------- // MARK: - MFViewProtocol //-------------------------------------------------- @@ -29,7 +39,7 @@ open override func setupView() { super.setupView() stack.setAndCreateModel(with: [eyebrow, headline, body, link]) - stack.stackModel?.spacing = 2.0 + stack.stackModel?.spacing = 0 addSubview(stack) NSLayoutConstraint.constraintPinSubview(toSuperview: stack) stack.restack() From 36f5c0f880b11d1eb81ca2ccaebb29c0470680fe Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 17 Mar 2021 15:08:56 -0400 Subject: [PATCH 07/13] refactoring --- MVMCoreUI/Utility/MVMCoreUIUtility.m | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index fad2378c..9e1070d4 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -11,6 +11,7 @@ #import "MVMCoreUISession.h" #import "MVMCoreUISplitViewController.h" #import +#import @import MVMCore.MVMCoreNavigationHandler; @import MVMCore.MVMCoreGetterUtility; @@ -23,15 +24,9 @@ return [NSBundle bundleWithIdentifier:@"com.vzw.MVMCoreUI"]; } -+ (BOOL)userPrefersSpanish { - // This should be enough for us to look at what the user prefers. - NSString *preference = [[[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2] lowercaseString]; - return [preference isEqualToString:@"es"] || [preference isEqualToString:@"es-mx"]; -} - + (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key { // If the app language is not english... force load from the english file anyway. - if ([MVMCoreUIUtility userPrefersSpanish]) { + if ([MVMCoreGetterUtility userPrefersSpanish]) { return [[NSBundle bundleWithPath:[[MVMCoreUIUtility bundleForMVMCoreUI] pathForResource:@"es" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil]; } else { return [[NSBundle bundleWithPath:[[MVMCoreUIUtility bundleForMVMCoreUI] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil]; @@ -40,7 +35,7 @@ + (nullable NSString *)localizedImageName:(nullable NSString *)imageName { if (imageName.length > 0) { - if ([MVMCoreUIUtility userPrefersSpanish]) { + if ([MVMCoreGetterUtility userPrefersSpanish]) { imageName = [NSString stringWithFormat:@"%@_es", imageName]; } else { imageName = [NSString stringWithFormat:@"%@_en", imageName]; From 9b8da4891d4ca1916fb0801083707818a1457510 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 18 Mar 2021 10:50:02 -0400 Subject: [PATCH 08/13] removed --- MVMCoreUI/Utility/MVMCoreUIUtility.h | 2 +- MVMCoreUI/Utility/MVMCoreUIUtility.m | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.h b/MVMCoreUI/Utility/MVMCoreUIUtility.h index 74b19d0e..6852e936 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.h +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Getters -//Returns localized imageName +// Returns localized imageName + (nullable NSString *)localizedImageName:(nullable NSString *)imageName; // The bundle for this framework diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index 9e1070d4..28ed2e0e 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -11,7 +11,6 @@ #import "MVMCoreUISession.h" #import "MVMCoreUISplitViewController.h" #import -#import @import MVMCore.MVMCoreNavigationHandler; @import MVMCore.MVMCoreGetterUtility; From 7f0cc11f2ab0bfe5f047322cfda61e08b917e22d Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 18 Mar 2021 10:08:19 -0500 Subject: [PATCH 09/13] formatting update Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift b/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift index e4ebe78a..da90798d 100644 --- a/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/MoleculeViewProtocol.swift @@ -9,7 +9,7 @@ import UIKit import MVMCore.MVMCoreViewProtocol -public protocol MoleculeViewProtocol: UIView, ModelHandlerProtocol{ +public protocol MoleculeViewProtocol: UIView, ModelHandlerProtocol { /// Initializes the view with the model init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) From a90824a23dbdf587c3dc4a1d81ca77c2ef7d5dce Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 18 Mar 2021 11:47:29 -0400 Subject: [PATCH 10/13] redirecting hardcoded key --- MVMCoreUI/Utility/MVMCoreUIUtility.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Utility/MVMCoreUIUtility.m b/MVMCoreUI/Utility/MVMCoreUIUtility.m index 28ed2e0e..dd059fed 100644 --- a/MVMCoreUI/Utility/MVMCoreUIUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUIUtility.m @@ -24,12 +24,8 @@ } + (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key { - // If the app language is not english... force load from the english file anyway. - if ([MVMCoreGetterUtility userPrefersSpanish]) { - return [[NSBundle bundleWithPath:[[MVMCoreUIUtility bundleForMVMCoreUI] pathForResource:@"es" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil]; - } else { - return [[NSBundle bundleWithPath:[[MVMCoreUIUtility bundleForMVMCoreUI] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil]; - } + // Redirect key with relevant module. + return [MVMCoreGetterUtility hardcodedStringWithKey:key bundle:[MVMCoreUIUtility bundleForMVMCoreUI]]; } + (nullable NSString *)localizedImageName:(nullable NSString *)imageName { From f37a839b95304b2dc24a27ffd5510d0b0cee3d64 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 22 Mar 2021 09:51:18 -0400 Subject: [PATCH 11/13] expanding image options --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 7e902d435..e8c8446f 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -685,7 +685,7 @@ public typealias ActionBlock = () -> () static func getTextAttachmentImage(name: String = "externalLink", dimension: CGFloat) -> NSTextAttachment { let imageAttachment = NSTextAttachment() - imageAttachment.image = MVMCoreUIUtility.imageNamed(name) + imageAttachment.image = MVMCoreCache.shared()?.getImageFromRegisteredBundles(name) imageAttachment.bounds = CGRect(x: 0, y: 0, width: dimension, height: dimension) return imageAttachment From 9d989c49faba65714cc315bd8df2365e528b8922 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Mon, 22 Mar 2021 20:28:25 +0530 Subject: [PATCH 12/13] Changed access specifiers of webview attributes for WebViewWithCheckbox component. --- MVMCoreUI/Atomic/Atoms/Views/WebView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/WebView.swift b/MVMCoreUI/Atomic/Atoms/Views/WebView.swift index 3de42935..e6708055 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/WebView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/WebView.swift @@ -16,8 +16,8 @@ import WebKit var webviewModel: WebViewModel? { return model as? WebViewModel } - var webView: WKWebView? - var overLayer = MVMCoreUICommonViewsUtility.commonView() + open var webView: WKWebView? + open var overLayer = MVMCoreUICommonViewsUtility.commonView() public let loadingSpinner = MFLoadingSpinner(frame: .zero) var delegateObject: MVMCoreUIDelegateObject? var webViewHeight: NSLayoutConstraint? From 8cba2a59d3a4ca5f2a642ff8d4f13e1c645abe65 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 24 Mar 2021 21:54:22 +0530 Subject: [PATCH 13/13] Returning moleculeName as type(of: self).identifier due to encoding/decoding error while converting to JsonArray or JsonDict. --- .../Item Dropdown/MultiItemDropdownEntryFieldModel.swift | 2 -- .../Atoms/FormFields/TextFields/TextEntryFieldModel.swift | 2 -- MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift | 2 -- .../Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift | 2 -- .../Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift | 2 +- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift index 2f645552..8799f6aa 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/MultiItemDropdownEntryFieldModel.swift @@ -86,7 +86,6 @@ import Foundation //-------------------------------------------------- private enum CodingKeys: String, CodingKey { - case moleculeName case components case selectedIndexes case delimiters @@ -120,7 +119,6 @@ import Foundation 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(components, forKey: .components) try container.encode(selectedIndexesArray, forKey: .selectedIndexes) try container.encodeIfPresent(delimiterArray, forKey: .delimiters) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift index 66b3d4bf..ca7543bd 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift @@ -95,7 +95,6 @@ //-------------------------------------------------- private enum CodingKeys: String, CodingKey { - case moleculeName case placeholder case textAlignment case enabledTextColor @@ -141,7 +140,6 @@ 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.encodeIfPresent(placeholder, forKey: .placeholder) try container.encodeIfPresent(textAlignment, forKey: .textAlignment) try container.encodeIfPresent(type, forKey: .type) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index 018a93d6..19348070 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -30,7 +30,6 @@ import Foundation //-------------------------------------------------- private enum CodingKeys: String, CodingKey { - case moleculeName case peakingUI case peakingArrowColor case analyticsData @@ -53,7 +52,6 @@ import Foundation 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) try container.encodeIfPresent(peakingUI, forKey: .peakingUI) try container.encodeIfPresent(peakingArrowColor, forKey: .peakingArrowColor) try container.encodeIfPresent(analyticsData, forKey: .analyticsData) diff --git a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift index 467ae6ac..56b77e3e 100644 --- a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift +++ b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMoleculeModel.swift @@ -36,7 +36,6 @@ open class BGImageMoleculeModel: MoleculeContainerModel { } private enum CodingKeys: String, CodingKey { - case moleculeName case image } @@ -54,7 +53,6 @@ open class BGImageMoleculeModel: MoleculeContainerModel { 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) try container.encode(image, forKey: .image) } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift index 4f0cd296..a998b79d 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift @@ -14,7 +14,7 @@ public protocol MoleculeModelProtocol: ModelProtocol, AccessibilityModelProtocol public extension MoleculeModelProtocol { - var moleculeName: String { Self.identifier } + var moleculeName: String { type(of: self).identifier } static var categoryName: String { "\(MoleculeModelProtocol.self)" }