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() } }