From 4d46d56f8e89717441735421df4553efdb3ab93e Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 12 Jul 2021 14:44:26 -0400 Subject: [PATCH] updates --- MVMCoreUI/Atomic/Atoms/Selectors/CheckboxModel.swift | 10 +--------- .../Behaviors/Protocols/PageBehaviorProtocol.swift | 5 +++++ MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift | 10 ++-------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/CheckboxModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/CheckboxModel.swift index 31f19bae..12330ada 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/CheckboxModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/CheckboxModel.swift @@ -79,15 +79,7 @@ self.selected = isChecked baseValue = isChecked } - - //-------------------------------------------------- - // MARK: - Behavior - //-------------------------------------------------- - - public func getRequiredBehaviors() -> [PageBehaviorModelProtocol] { - [SelectAllBoxesBehaviorModel()] - } - + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift index e7db54bc..3f14f3cc 100644 --- a/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift +++ b/MVMCoreUI/Behaviors/Protocols/PageBehaviorProtocol.swift @@ -41,6 +41,11 @@ public protocol PageLocalDataShareBehavior: PageBehaviorProtocol { public protocol PageCustomActionHandlerBehavior: PageBehaviorProtocol { + /// - Parameters: + /// - actionType: The action type of the passed action model. + /// - information: information of the passed action model. + /// - additionalData: Additional information of the + /// - Returns: Boolean determines if the action has been handled. func handleAction(type actionType: String?, information: [AnyHashable : Any]?, additionalData: [AnyHashable : Any]?) -> Bool } diff --git a/MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift b/MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift index 3837eaa9..3877bfd1 100644 --- a/MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift +++ b/MVMCoreUI/Behaviors/SelectAllBoxesBehavior.swift @@ -41,7 +41,7 @@ public class SelectAllBoxesBehavior: PageCustomActionHandlerBehavior, PageMolecu // MARK: - Delegate //-------------------------------------------------- - var delegate: MVMCoreUIDelegateObject? + weak var delegate: MVMCoreUIDelegateObject? //-------------------------------------------------- // MARK: - Init @@ -69,13 +69,7 @@ public class SelectAllBoxesBehavior: PageCustomActionHandlerBehavior, PageMolecu // MARK: - Custom Action //-------------------------------------------------- - /// To select or deselect all controls adhereing to `SelectableMoleculeModel` - /// - /// - Parameters: - /// - actionType: The action type of the passed action model. - /// - information: information of the passed action model. - /// - additionalData: Additional information of the - /// - Returns: Boolean determines if the action has been handled. + // To select or deselect all controls adhereing to `SelectableMoleculeModel` public func handleAction(type actionType: String?, information: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?) -> Bool { // Verify we have the correct action type and necessary values.