From 3b75e3dc5a27c648d7bcc1a4513419e38064be8f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 4 Apr 2023 12:03:31 -0500 Subject: [PATCH] updated Signed-off-by: Matt Bruce --- .../NotificationViewController.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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() {