diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift index ddffb179..c93a22db 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift @@ -12,7 +12,7 @@ import VDS import MVMCore import Combine -open class PillButton: VDS.Button, MVMCoreUIViewConstrainingProtocol, MoleculeViewProtocol, MVMCoreViewProtocol, MFButtonProtocol, VDSMoleculeViewProtocol { +open class PillButton: VDS.Button, MVMCoreUIViewConstrainingProtocol, MFButtonProtocol, VDSMoleculeViewProtocol { //-------------------------------------------------- // MARK: - Properties @@ -81,13 +81,12 @@ open class PillButton: VDS.Button, MVMCoreUIViewConstrainingProtocol, MoleculeVi //-------------------------------------------------- open func set(with actionModel: ActionModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { - onClickSubscriber = publisher(for: .touchUpInside) - .sink {[weak self] control in - guard let self = self else { return } - Task(priority: .userInitiated) { - try await Self.performButtonAction(with: self.viewModel.action, button: self, delegateObject: delegateObject, additionalData: additionalData, sourceModel: self.viewModel) - } + onClick = { [weak self] control in + guard let self = self, let viewModel = self.viewModel else { return } + Task(priority: .userInitiated) { + try await Self.performButtonAction(with: viewModel.action, button: self, delegateObject: delegateObject, additionalData: additionalData, sourceModel: viewModel) } + } } open class func performButtonAction(with model: ActionModelProtocol, button: MFButtonProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?, sourceModel: MoleculeModelProtocol? = nil) async throws {