From f74372c56ed124926d9f338231f06165b4dc63f0 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Mon, 12 Jul 2021 20:07:50 +0530 Subject: [PATCH] Changes are per review comments --- .../ListLeftVariableIconWithRightCaretBodyTextModel.swift | 2 +- MVMCoreUI/Behaviors/PlayAudioBehavior.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift index 88eec8ea..33e00982 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift @@ -7,7 +7,7 @@ // -public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, MoleculeModelProtocol { +public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, ParentMoleculeModelProtocol { //----------------------------------------------------- // MARK: - Properties //----------------------------------------------------- diff --git a/MVMCoreUI/Behaviors/PlayAudioBehavior.swift b/MVMCoreUI/Behaviors/PlayAudioBehavior.swift index 4775d131..12a98022 100644 --- a/MVMCoreUI/Behaviors/PlayAudioBehavior.swift +++ b/MVMCoreUI/Behaviors/PlayAudioBehavior.swift @@ -29,13 +29,13 @@ public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior { // MARK: - Active Model //-------------------------------------------------- - public static var activeAudioPlayerDelegate: PagePlayAudioBehaviorConsumerProtocol? + public static var activeAudioPlayerDelegate: PagePlayAudioBehaviorConsumerProtocol? //-------------------------------------------------- // MARK: - Delegate //-------------------------------------------------- - var delegate: MVMCoreUIDelegateObject? + weak var delegate: MVMCoreUIDelegateObject? //-------------------------------------------------- // MARK: - Init @@ -57,7 +57,6 @@ public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior { // Update the model. play -> pause OR pause -> play if Self.activeAudioPlayerDelegate?.isPlaying ?? false { Self.activeAudioPlayerDelegate?.pause() - } else { Self.activeAudioPlayerDelegate?.play() } @@ -65,6 +64,7 @@ public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior { } public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) { - // TODO: Stop player + //Stop player + Self.activeAudioPlayerDelegate?.pause() } }