diff --git a/VDSSample/ViewControllers/TileletViewController.swift b/VDSSample/ViewControllers/TileletViewController.swift index a9f385a..e6c7163 100644 --- a/VDSSample/ViewControllers/TileletViewController.swift +++ b/VDSSample/ViewControllers/TileletViewController.swift @@ -44,7 +44,7 @@ class TileletViewController: BaseViewController { }() var clickableSwitch = Toggle() - + var eyebrowTextField = TextField() var titleTextField = TextField() var subTitleTextField = TextField() var widthTextField = NumericField() @@ -75,6 +75,7 @@ class TileletViewController: BaseViewController { addFormRow(label: "Other Style", view: otherStandardStylePickerSelectorView) addFormRow(label: "Padding", view: paddingPickerSelectorView) + addFormRow(label: "Eyebrow Text", view: eyebrowTextField) addFormRow(label: "Title Text", view: titleTextField) addFormRow(label: "Title is Bold", view: titleIsBold) addFormRow(label: "Subtitle Color", view: subtitleColorPickerSelectorView) @@ -183,6 +184,10 @@ class TileletViewController: BaseViewController { self?.component.padding = item } + eyebrowTextField.textPublisher + .sink { [weak self] text in + self?.setEyebrowModel() + }.store(in: &subscribers) } func setupModel() { @@ -230,6 +235,14 @@ class TileletViewController: BaseViewController { } } + func setEyebrowModel() { + if let text = eyebrowTextField.text, !text.isEmpty { + component.eyebrowModel = Tilelet.EyebrowModel(text: text, standardStyle: otherStandardStylePickerSelectorView.selectedItem) + } else { + component.eyebrowModel = nil + } + } + func updateOtherTextStyles() { let items = component.titleLockup.standardStyleConfiguration.configuration(for: titleStandardStylePickerSelectorView.selectedItem.value)!.allOtherStandardStyles let otheritems = items.compactMap { Tilelet.SubTitleModel.OtherStandardStyle(rawValue: $0.rawValue)! }