retain cycle fix

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-15 09:14:18 -05:00
parent 80e23e190a
commit 263e692bad
3 changed files with 21 additions and 23 deletions

View File

@ -142,10 +142,10 @@ class CheckboxViewController: UIViewController, StoryboardInitable {
func setupPicker(){
picker.isHidden = true
surfacePicker.onPickerDidSelect = { item in
self.checkbox.surface = item
self.checkboxContainerView.backgroundColor = item.color
self.surfaceLabel.text = item.rawValue
surfacePicker.onPickerDidSelect = { [weak self] item in
self?.checkbox.surface = item
self?.checkboxContainerView.backgroundColor = item.color
self?.surfaceLabel.text = item.rawValue
}
}
}

View File

@ -31,8 +31,6 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
@IBOutlet weak var childTextField: UITextField!
@IBOutlet weak var showErrorSwitch: UISwitch!
// var radioButton: RadioButton!
// var radioButton2: RadioButton!
var radioButtonGroup = RadioButtonGroup()
public var model = DefaultRadioButtonGroupModel()
public var subscribers = Set<AnyCancellable>()
@ -150,10 +148,10 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
func setupPicker(){
picker.isHidden = true
surfacePicker.onPickerDidSelect = { item in
self.radioButtonGroup.surface = item
self.componentContainerView.backgroundColor = item.color
self.surfaceLabel.text = item.rawValue
surfacePicker.onPickerDidSelect = { [weak self] item in
self?.radioButtonGroup.surface = item
self?.componentContainerView.backgroundColor = item.color
self?.surfaceLabel.text = item.rawValue
}
}
}

View File

@ -112,25 +112,25 @@ class ToggleViewController: UIViewController, StoryboardInitable {
func setupPicker(){
picker.isHidden = true
surfacePicker.onPickerDidSelect = { item in
self.toggle.surface = item
self.toggleContainerView.backgroundColor = item.color
self.surfaceLabel.text = item.rawValue
surfacePicker.onPickerDidSelect = { [weak self] item in
self?.toggle.surface = item
self?.toggleContainerView.backgroundColor = item.color
self?.surfaceLabel.text = item.rawValue
}
fontWeightPicker.onPickerDidSelect = { item in
self.toggle.fontWeight = item
self.fontWeightLabel.text = item.rawValue
fontWeightPicker.onPickerDidSelect = { [weak self] item in
self?.toggle.fontWeight = item
self?.fontWeightLabel.text = item.rawValue
}
textSizePicker.onPickerDidSelect = { item in
self.toggle.fontSize = item
self.textSizeLabel.text = item.rawValue
textSizePicker.onPickerDidSelect = { [weak self] item in
self?.toggle.fontSize = item
self?.textSizeLabel.text = item.rawValue
}
textPositionPicker.onPickerDidSelect = { item in
self.toggle.textPosition = item
self.textPositionLabel.text = item.rawValue
textPositionPicker.onPickerDidSelect = { [weak self] item in
self?.toggle.textPosition = item
self?.textPositionLabel.text = item.rawValue
}
}
}