From 862fa066dd1dd9413004b2816c22795329cdb9cd Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 8 Jun 2020 17:28:58 +0530 Subject: [PATCH 1/3] 1. Changing imageName to image as per doc: https://oneconfluence.verizon.com/display/MFD/Navigation+Image+Button --- .../Buttons/NavigationImageButtonModel.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift index aff9c58f..dc208949 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift @@ -11,34 +11,34 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule public var backgroundColor: Color? public static var identifier: String = "navigationImageButton" - public var imageName: String + public var image: String public var action: ActionModelProtocol - public init(with imageName: String, action: ActionModelProtocol) { - self.imageName = imageName + public init(with image: String, action: ActionModelProtocol) { + self.image = image self.action = action } private enum CodingKeys: String, CodingKey { - case imageName + case image case action } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - imageName = try typeContainer.decode(String.self, forKey: .imageName) + image = try typeContainer.decode(String.self, forKey: .image) action = try typeContainer.decodeModel(codingKey: .action) } open func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(imageName, forKey: .imageName) + try container.encode(image, forKey: .image) try container.encodeModel(action, forKey: .action) } /// Convenience function that creates a BarButtonItem for the model. public func createNavigationItemButton(delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> UIBarButtonItem { - let image = UIImage(named: imageName, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) - return ImageBarButtonItem.create(with: image, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) + let imageName = UIImage(named: image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) + return ImageBarButtonItem.create(with: imageName, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) } } From 18f146f668f03b93fa89faabb188d3bcc3ef192d Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Wed, 10 Jun 2020 00:30:52 +0530 Subject: [PATCH 2/3] making few objects open to use in MF --- MVMCoreUI/BaseClasses/BarButtonItem.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseClasses/BarButtonItem.swift b/MVMCoreUI/BaseClasses/BarButtonItem.swift index 93eb63a3..e979e04f 100644 --- a/MVMCoreUI/BaseClasses/BarButtonItem.swift +++ b/MVMCoreUI/BaseClasses/BarButtonItem.swift @@ -8,9 +8,9 @@ public typealias BarButtonAction = (BarButtonItem) -> () -@objc class ActionDelegate: NSObject { - var buttonAction: BarButtonAction? - @objc func callActionBlock(_ sender: BarButtonItem) { +@objc open class ActionDelegate: NSObject { + open var buttonAction: BarButtonAction? + @objc open func callActionBlock(_ sender: BarButtonItem) { buttonAction?(sender) } } @@ -22,7 +22,7 @@ public typealias BarButtonAction = (BarButtonItem) -> () //-------------------------------------------------- open weak var buttonDelegate: ButtonDelegateProtocol? - var actionDelegate: ActionDelegate? + open var actionDelegate: ActionDelegate? //-------------------------------------------------- // MARK: - Methods From b3020d9534db24ec11cdda6021e29a51f599669e Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Fri, 12 Jun 2020 00:57:36 +0530 Subject: [PATCH 3/3] Implemented Scott Feedback. Removed open keyword. --- MVMCoreUI/BaseClasses/BarButtonItem.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseClasses/BarButtonItem.swift b/MVMCoreUI/BaseClasses/BarButtonItem.swift index e979e04f..93eb63a3 100644 --- a/MVMCoreUI/BaseClasses/BarButtonItem.swift +++ b/MVMCoreUI/BaseClasses/BarButtonItem.swift @@ -8,9 +8,9 @@ public typealias BarButtonAction = (BarButtonItem) -> () -@objc open class ActionDelegate: NSObject { - open var buttonAction: BarButtonAction? - @objc open func callActionBlock(_ sender: BarButtonItem) { +@objc class ActionDelegate: NSObject { + var buttonAction: BarButtonAction? + @objc func callActionBlock(_ sender: BarButtonItem) { buttonAction?(sender) } } @@ -22,7 +22,7 @@ public typealias BarButtonAction = (BarButtonItem) -> () //-------------------------------------------------- open weak var buttonDelegate: ButtonDelegateProtocol? - open var actionDelegate: ActionDelegate? + var actionDelegate: ActionDelegate? //-------------------------------------------------- // MARK: - Methods