vds_ios_sample/VDSSample/ViewControllers/LineViewController.swift
Matt Bruce 02b1230d70 updated ui for button/line fixes
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-09-19 12:01:51 -05:00

61 lines
1.7 KiB
Swift

//
// LineViewController.swift
// VDSSample
//
// Created by Nadigadda, Sumanth on 24/03/23.
//
import Foundation
import VDS
class LineViewController: BaseViewController<Line> {
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)
}
}