added ability to return views in addRow

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-06-09 14:18:25 -05:00
parent f8085bb258
commit 79a51f7239

View File

@ -209,12 +209,14 @@ public class BaseViewController<Component: UIView>: 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() {