// // LineViewController.swift // VDSSample // // Created by Nadigadda, Sumanth on 24/03/23. // import Foundation import VDS class LineViewController: BaseViewController { lazy var lineStylePickerView = { PickerSelectorView(title: "primary", picker: self.picker, items: Line.Style.allCases) }() lazy var orientationPickerView = { PickerSelectorView(title:"horizontal", picker: self.picker, items: Line.Orientation.allCases) }() override func viewDidLoad() { super.viewDidLoad() addContentTopView(view: component) component.height(30) setupPicker() } override func setupForm() { super.setupForm() addFormRow(label: "Surface", view: surfacePickerSelectorView) addFormRow(label: "Style", view: lineStylePickerView) addFormRow(label: "Orientation", view: orientationPickerView) } func setupPicker() { surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in self?.component.surface = item self?.contentTopView.backgroundColor = item.color } lineStylePickerView.onPickerDidSelect = { [weak self] item in self?.component.style = item } orientationPickerView.onPickerDidSelect = { [weak self] item in self?.component.orientation = item } } } extension LineViewController: ComponentSampleable { static func makeSample() -> ComponentSample { let component = Self.makeComponent() return ComponentSample(component: component) } }