diff --git a/VDSSample/ViewControllers/NotificationViewController.swift b/VDSSample/ViewControllers/NotificationViewController.swift index 82f1942..03fb2ea 100644 --- a/VDSSample/ViewControllers/NotificationViewController.swift +++ b/VDSSample/ViewControllers/NotificationViewController.swift @@ -104,20 +104,13 @@ class NotificationViewController: BaseViewController { } }.store(in: &subscribers) - hideCloseButtonToggle.publisher(for: .valueChanged).sink(receiveValue: { [weak self] toggle in + hideCloseButtonToggle.onChange = { [weak self] toggle in self?.notificationView.hideCloseButton = toggle.isOn - }).store(in: &subscribers) + } - fullBleedToggle.publisher(for: .valueChanged).sink(receiveValue: { [weak self] toggle in + fullBleedToggle.onChange = { [weak self] toggle in self?.notificationView.fullBleed = toggle.isOn - - let isFullBleed = self?.notificationView.fullBleed ?? false - - self?.notificationView.leadingConstraint?.constant = isFullBleed ? 0 : 16 - self?.notificationView.trailingConstraint?.constant = isFullBleed ? 0 : 16 - self?.notificationView.leadingConstraint?.isActive = isFullBleed - self?.notificationView.trailingConstraint?.isActive = isFullBleed - }).store(in: &subscribers) + } } func setupPicker() {