From 79a51f72397908e712b9106ba5198716bd456d84 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 9 Jun 2023 14:18:25 -0500 Subject: [PATCH] added ability to return views in addRow Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/BaseViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/VDSSample/ViewControllers/BaseViewController.swift b/VDSSample/ViewControllers/BaseViewController.swift index 45374ee..c5644f5 100644 --- a/VDSSample/ViewControllers/BaseViewController.swift +++ b/VDSSample/ViewControllers/BaseViewController.swift @@ -209,12 +209,14 @@ public class BaseViewController: UIViewController, Initable { open func append(section: FormSection) { formStackView.addArrangedSubview(section) } - - open func addFormRow(label: String, view: UIView) { - formStackView.addFormRow(label: label, view: view) + + @discardableResult + open func addFormRow(label: String, view: UIView) -> UIView { + let view = formStackView.addFormRow(label: label, view: view) if let pickerViewable = view as? any PickerViewable { pickerViewable.scrollToBottom = { [weak self] in self?.scrollToBottom() } } + return view } open func setup() {