fixed leaks
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
09f4fa7545
commit
6dda644f3b
@ -73,31 +73,34 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
|
|||||||
print("onCloseClick: \(notification.title)")
|
print("onCloseClick: \(notification.title)")
|
||||||
}
|
}
|
||||||
|
|
||||||
titleTextField.textPublisher.sink { newString in
|
titleTextField.textPublisher.sink { [weak self] newString in
|
||||||
|
guard let self else { return }
|
||||||
self.component.title = newString
|
self.component.title = newString
|
||||||
self.notification.title = newString
|
self.notification.title = newString
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
subTitleTextField.textPublisher.sink { newString in
|
subTitleTextField.textPublisher.sink { [weak self] newString in
|
||||||
|
guard let self else { return }
|
||||||
self.component.subTitle = newString
|
self.component.subTitle = newString
|
||||||
self.notification.subTitle = newString
|
self.notification.subTitle = newString
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
buttonGroupToggle.onChange = { [weak self] toggle in
|
buttonGroupToggle.onChange = { [weak self] toggle in
|
||||||
|
guard let self else { return }
|
||||||
if toggle.isOn {
|
if toggle.isOn {
|
||||||
self?.component.primaryButtonModel = nil
|
self.component.primaryButtonModel = nil
|
||||||
self?.component.secondaryButtonModel = nil
|
self.component.secondaryButtonModel = nil
|
||||||
self?.notification.primaryButtonModel = nil
|
self.notification.primaryButtonModel = nil
|
||||||
self?.notification.secondaryButtonModel = nil
|
self.notification.secondaryButtonModel = nil
|
||||||
|
|
||||||
self?.label.text = ""
|
self.label.text = ""
|
||||||
} else {
|
} else {
|
||||||
self?.setupButtons(with: self?.firstButtonDefaultText, secondButtonText: self?.secondButtonDefaultText)
|
self.setupButtons(with: self.firstButtonDefaultText, secondButtonText: self.secondButtonDefaultText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
firstButtonTextField.textPublisher.sink { newString in
|
firstButtonTextField.textPublisher.sink { [weak self] newString in
|
||||||
|
guard let self else { return }
|
||||||
if newString.isEmpty {
|
if newString.isEmpty {
|
||||||
self.component.primaryButtonModel = nil
|
self.component.primaryButtonModel = nil
|
||||||
self.component.secondaryButtonModel = nil
|
self.component.secondaryButtonModel = nil
|
||||||
@ -107,29 +110,33 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
|
|||||||
|
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
secondButtonTextField.textPublisher.sink { newString in
|
secondButtonTextField.textPublisher.sink { [weak self] newString in
|
||||||
|
guard let self else { return }
|
||||||
if !(self.firstButtonTextField.text?.isEmpty ?? true){
|
if !(self.firstButtonTextField.text?.isEmpty ?? true){
|
||||||
self.setupButtons(secondButtonText: newString)
|
self.setupButtons(secondButtonText: newString)
|
||||||
}
|
}
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
hideCloseButtonToggle.onChange = { [weak self] toggle in
|
hideCloseButtonToggle.onChange = { [weak self] toggle in
|
||||||
self?.component.hideCloseButton = toggle.isOn
|
guard let self else { return }
|
||||||
self?.notification.hideCloseButton = toggle.isOn
|
self.component.hideCloseButton = toggle.isOn
|
||||||
|
self.notification.hideCloseButton = toggle.isOn
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupPicker() {
|
func setupPicker() {
|
||||||
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.component.surface = item
|
guard let self else { return }
|
||||||
self?.notification.surface = item
|
self.component.surface = item
|
||||||
self?.contentTopView.backgroundColor = item.color
|
self.notification.surface = item
|
||||||
|
self.contentTopView.backgroundColor = item.color
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
notificationTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.component.style = item
|
guard let self else { return }
|
||||||
self?.notification.style = item
|
self.component.style = item
|
||||||
|
self.notification.style = item
|
||||||
}
|
}
|
||||||
|
|
||||||
layoutTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
layoutTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user