From 6a825b4e4b6f47ea18b6c0ab2642553fe8b55e30 Mon Sep 17 00:00:00 2001 From: "Tondapu, Alekhya" Date: Mon, 4 Oct 2021 17:22:02 +0530 Subject: [PATCH 1/6] changed access specifier to open --- .../Atoms/FormFields/TextFields/TextEntryFieldModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift index 3e600734..7c2dfa9b 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift @@ -137,7 +137,7 @@ } } - 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.encodeIfPresent(placeholder, forKey: .placeholder) From b946be833f615956023c15f9a689f61e467b24d5 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 14 Oct 2021 12:37:47 -0500 Subject: [PATCH 2/6] implemented prepareForDisplay protocol Signed-off-by: Matt Bruce --- .../Containers/NavigationController.swift | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index e74671ad..a332467b 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -46,11 +46,16 @@ import UIKit } /// Convenience function for setting the navigation item. - public static func setNavigationItem(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { + public static func setNavigationItemProperties(navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { viewController.navigationItem.title = navigationItemModel.title viewController.navigationItem.accessibilityLabel = navigationItemModel.title viewController.navigationItem.hidesBackButton = navigationItemModel.hidesSystemBackButton viewController.navigationItem.leftItemsSupplementBackButton = !navigationItemModel.hidesSystemBackButton + } + + /// Convenience function for setting the navigation item. + public static func setNavigationItem(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { + setNavigationItemProperties(navigationItemModel: navigationItemModel, viewController: viewController) setNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) setNavigationTitleView(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) } @@ -152,6 +157,14 @@ extension NavigationController: MVMCoreViewManagerProtocol { manager?.newDataReceived?(in: viewController) } + public func prepareDisplay(for viewController: UIViewController) { + if let topViewController = topViewController, + let model = getNavigationModel(from: viewController) { + Self.setNavigationItemProperties(navigationItemModel: model, viewController: topViewController) + } + manager?.prepareDisplay?(for: viewController) + } + public func willDisplay(_ viewController: UIViewController) { if let topViewController = topViewController, let model = getNavigationModel(from: viewController) { @@ -171,6 +184,15 @@ extension NavigationController: MVMCoreViewManagerProtocol { } extension NavigationController: MVMCorePresentationDelegateProtocol { + public func navigationController(_ navigationController: UINavigationController, prepareDisplayFor viewController: UIViewController) { + guard self == navigationController else { return } + guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } + if let model = getNavigationModel(from: newViewController) { + Self.setNavigationItemProperties(navigationItemModel: model, viewController: newViewController) + } + manager?.prepareDisplay?(for: viewController) + } + public func navigationController(_ navigationController: UINavigationController, willDisplay viewController: UIViewController) { guard self == navigationController else { return } if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) { From b06f26468e11e6af4a7247b35ead1f61036cbb02 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 18 Oct 2021 13:19:37 -0400 Subject: [PATCH 3/6] revert --- .../Containers/NavigationController.swift | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index a332467b..afb463c3 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -46,16 +46,11 @@ import UIKit } /// Convenience function for setting the navigation item. - public static func setNavigationItemProperties(navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { + public static func setNavigationItem(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { viewController.navigationItem.title = navigationItemModel.title viewController.navigationItem.accessibilityLabel = navigationItemModel.title viewController.navigationItem.hidesBackButton = navigationItemModel.hidesSystemBackButton viewController.navigationItem.leftItemsSupplementBackButton = !navigationItemModel.hidesSystemBackButton - } - - /// Convenience function for setting the navigation item. - public static func setNavigationItem(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { - setNavigationItemProperties(navigationItemModel: navigationItemModel, viewController: viewController) setNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) setNavigationTitleView(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) } @@ -157,14 +152,6 @@ extension NavigationController: MVMCoreViewManagerProtocol { manager?.newDataReceived?(in: viewController) } - public func prepareDisplay(for viewController: UIViewController) { - if let topViewController = topViewController, - let model = getNavigationModel(from: viewController) { - Self.setNavigationItemProperties(navigationItemModel: model, viewController: topViewController) - } - manager?.prepareDisplay?(for: viewController) - } - public func willDisplay(_ viewController: UIViewController) { if let topViewController = topViewController, let model = getNavigationModel(from: viewController) { @@ -185,16 +172,6 @@ extension NavigationController: MVMCoreViewManagerProtocol { extension NavigationController: MVMCorePresentationDelegateProtocol { public func navigationController(_ navigationController: UINavigationController, prepareDisplayFor viewController: UIViewController) { - guard self == navigationController else { return } - guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } - if let model = getNavigationModel(from: newViewController) { - Self.setNavigationItemProperties(navigationItemModel: model, viewController: newViewController) - } - manager?.prepareDisplay?(for: viewController) - } - - public func navigationController(_ navigationController: UINavigationController, willDisplay viewController: UIViewController) { - guard self == navigationController else { return } if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) { MVMCoreViewManagerViewControllerProtocolHelper.helpSetManager(self, viewController: controller) } From 7f40b9ea738977179d6f54725e962c4707981b3b Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 18 Oct 2021 16:53:57 -0400 Subject: [PATCH 4/6] manager timing.... --- MVMCoreUI/Containers/NavigationController.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index afb463c3..c6a50fef 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -172,13 +172,17 @@ extension NavigationController: MVMCoreViewManagerProtocol { extension NavigationController: MVMCorePresentationDelegateProtocol { public func navigationController(_ navigationController: UINavigationController, prepareDisplayFor viewController: UIViewController) { - if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) { - MVMCoreViewManagerViewControllerProtocolHelper.helpSetManager(self, viewController: controller) - } guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } if let model = getNavigationModel(from: newViewController) { Self.setNavigationItem(navigationController: self, navigationItemModel: model, viewController: viewController) } + } + + public func navigationController(_ navigationController: UINavigationController, willDisplay viewController: UIViewController) { + guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } + if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) { + MVMCoreViewManagerViewControllerProtocolHelper.helpSetManager(self, viewController: controller) + } manager?.willDisplay?(newViewController) } From 66973bd4cb02573d04a54f5059e3113a61111a48 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 18 Oct 2021 17:03:26 -0400 Subject: [PATCH 5/6] added checks --- MVMCoreUI/Containers/NavigationController.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index c6a50fef..c2b63a6e 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -172,14 +172,15 @@ extension NavigationController: MVMCoreViewManagerProtocol { extension NavigationController: MVMCorePresentationDelegateProtocol { public func navigationController(_ navigationController: UINavigationController, prepareDisplayFor viewController: UIViewController) { - guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } - if let model = getNavigationModel(from: newViewController) { - Self.setNavigationItem(navigationController: self, navigationItemModel: model, viewController: viewController) - } + guard self == navigationController, + let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController), + let model = getNavigationModel(from: newViewController) else { return } + Self.setNavigationItem(navigationController: self, navigationItemModel: model, viewController: viewController) } public func navigationController(_ navigationController: UINavigationController, willDisplay viewController: UIViewController) { - guard let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } + guard self == navigationController, + let newViewController = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController) else { return } if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) { MVMCoreViewManagerViewControllerProtocolHelper.helpSetManager(self, viewController: controller) } From 3a1ad0f93dd18dcf56fb0da80d8923988e45b562 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 21 Oct 2021 15:06:31 -0500 Subject: [PATCH 6/6] call super handleOtherActions in an subclassed method --- MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m b/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m index e2adbd74..3673d99e 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIActionHandler.m @@ -35,7 +35,7 @@ [self topNotificationAction:actionInformation additionalData:additionalData delegateObject:delegateObject]; return YES; } - return NO; + return [super handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]; } - (void)openPageAction:(NSDictionary *)actionInformation additionalData:(NSDictionary *)additionalData delegateObject:(DelegateObject *)delegateObject {