diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift index 0152771e..89acf4c2 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift @@ -26,7 +26,13 @@ open class Toggle: ToggleBase, VDSMoleculeViewProtocol { public var viewModel: ToggleModel! public var delegateObject: MVMCoreUIDelegateObject? public var additionalData: [AnyHashable: Any]? - public var valueChangedSubscription: AnyCancellable? + public var valueChangedSubscription: AnyCancellable? { + willSet{ + if let current = valueChangedSubscription { + current.cancel() + } + } + } //-------------------------------------------------- // MARK: - Initializers