updated to allow FormSection Title
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ab5d88b4d8
commit
e9af0b721c
@ -11,6 +11,19 @@ import Combine
|
|||||||
import VDS
|
import VDS
|
||||||
|
|
||||||
public class FormSection: UIStackView {
|
public class FormSection: UIStackView {
|
||||||
|
public var title: String? {
|
||||||
|
didSet {
|
||||||
|
if let title {
|
||||||
|
titleLabel.text = title
|
||||||
|
titleLabel.isHidden = false
|
||||||
|
} else {
|
||||||
|
titleLabel.isHidden = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var titleLabel = Label().with { $0.isHidden = true; $0.textStyle = .boldBodyLarge }
|
||||||
|
|
||||||
public override init(frame: CGRect) {
|
public override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
@ -18,6 +31,7 @@ public class FormSection: UIStackView {
|
|||||||
distribution = .fill
|
distribution = .fill
|
||||||
axis = .vertical
|
axis = .vertical
|
||||||
spacing = 10
|
spacing = 10
|
||||||
|
addArrangedSubview(titleLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
public convenience init() {
|
public convenience init() {
|
||||||
|
|||||||
@ -76,6 +76,19 @@ class DropShadowViewController: BaseViewController<View> {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
let label1 = Label().with { $0.text = "View 1"; $0.textAlignment = .center}
|
||||||
|
let label2 = Label().with { $0.text = "View 2"; $0.textAlignment = .center}
|
||||||
|
let label3 = Label().with { $0.text = "View 3"; $0.textAlignment = .center}
|
||||||
|
|
||||||
|
component.addSubview(label1)
|
||||||
|
label1.pinToSuperView()
|
||||||
|
|
||||||
|
secondView.addSubview(label2)
|
||||||
|
label2.pinToSuperView()
|
||||||
|
|
||||||
|
thirdView.addSubview(label3)
|
||||||
|
label3.pinToSuperView()
|
||||||
|
|
||||||
let wrapper = UIView.makeWrapperWithConstraints(for: component, isTrailing: false)
|
let wrapper = UIView.makeWrapperWithConstraints(for: component, isTrailing: false)
|
||||||
componentWrapper = wrapper.view
|
componentWrapper = wrapper.view
|
||||||
componentConstraints = wrapper.container
|
componentConstraints = wrapper.container
|
||||||
@ -117,19 +130,29 @@ class DropShadowViewController: BaseViewController<View> {
|
|||||||
|
|
||||||
override func setupForm(){
|
override func setupForm(){
|
||||||
super.setupForm()
|
super.setupForm()
|
||||||
|
formStackView.title = "Screen Settings"
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
addFormRow(label: "Space Between Views", view: viewSpacerRange)
|
addFormRow(label: "Space Between 1,2,3", view: viewSpacerRange)
|
||||||
addFormRow(label: "View Padding", view: viewPaddingRange)
|
|
||||||
addFormRow(label: "View Corner Radius", view: viewRadiusRange)
|
|
||||||
addFormRow(label: "View Light", view: viewLightColorPickerSelectorView)
|
|
||||||
addFormRow(label: "View Dark", view: viewDarkColorPickerSelectorView)
|
|
||||||
addFormRow(label: "Shawdow Light", view: dropShadowLightColorPickerSelectorView)
|
|
||||||
addFormRow(label: "Shawdow Dark", view: dropShadowDarkColorPickerSelectorView)
|
|
||||||
|
|
||||||
addFormRow(label: "Opacity", view: opacityRange)
|
let form1 = FormSection()
|
||||||
addFormRow(label: "Radius (Blur)", view: radiusRange)
|
form1.title = "View 1 Settings"
|
||||||
addFormRow(label: "Width (OffSet X)", view: offsetXRange)
|
form1.addFormRow(label: "All ", view: viewPaddingRange)
|
||||||
addFormRow(label: "Height (Offset Y)", view: offsetYRange)
|
form1.addFormRow(label: "Padding", view: viewPaddingRange)
|
||||||
|
form1.addFormRow(label: "Corner Radius", view: viewRadiusRange)
|
||||||
|
form1.addFormRow(label: "Light", view: viewLightColorPickerSelectorView)
|
||||||
|
form1.addFormRow(label: "Dark", view: viewDarkColorPickerSelectorView)
|
||||||
|
|
||||||
|
let form2 = FormSection()
|
||||||
|
form2.title = "View 1 Shadow Settings"
|
||||||
|
form2.addFormRow(label: "Shawdow Light", view: dropShadowLightColorPickerSelectorView)
|
||||||
|
form2.addFormRow(label: "Shawdow Dark", view: dropShadowDarkColorPickerSelectorView)
|
||||||
|
form2.addFormRow(label: "Opacity", view: opacityRange)
|
||||||
|
form2.addFormRow(label: "Radius (Blur)", view: radiusRange)
|
||||||
|
form2.addFormRow(label: "Width (OffSet X)", view: offsetXRange)
|
||||||
|
form2.addFormRow(label: "Height (Offset Y)", view: offsetYRange)
|
||||||
|
|
||||||
|
append(section: form1)
|
||||||
|
append(section: form2)
|
||||||
|
|
||||||
opacityRange.maximumValue = 1.0
|
opacityRange.maximumValue = 1.0
|
||||||
opacityRange.minimumValue = 0.0
|
opacityRange.minimumValue = 0.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user