Digital ACT-191 ONEAPP-6827 story: setup form for Breadcrumbs page
This commit is contained in:
parent
b42d910b79
commit
d647a29871
@ -99,4 +99,11 @@ extension BaseViewController {
|
|||||||
$0.labelPublisher(label)
|
$0.labelPublisher(label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func makeBreadcrumbItem(_ text: String, label: UILabel) -> BreadcrumbItem {
|
||||||
|
return BreadcrumbItem().with{
|
||||||
|
$0.text = text
|
||||||
|
$0.labelPublisher(label)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,4 +13,47 @@ import Combine
|
|||||||
|
|
||||||
class BreadcrumbsViewController: BaseViewController<Breadcrumbs> {
|
class BreadcrumbsViewController: BaseViewController<Breadcrumbs> {
|
||||||
|
|
||||||
|
var selectedSwitch = Toggle()
|
||||||
|
let breadCrumbs = Breadcrumbs()
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
let label = actionLabel
|
||||||
|
addContentTopView(view: .makeWrapper(for: component))
|
||||||
|
component.breadcrumbItems = [
|
||||||
|
makeBreadcrumbItem("Home", label: label).with{ $0.link = "https://www.verizon.com/" },
|
||||||
|
makeBreadcrumbItem("Support", label: label).with{ $0.link = "https://www.verizon.com/"; $0.selectable = false },
|
||||||
|
makeBreadcrumbItem("Servie & Apps", label: label).with{ $0.link = "https://www.verizon.com/" },
|
||||||
|
makeBreadcrumbItem("My Verizon", label: label).with{ $0.link = "https://www.verizon.com/"; $0.selectable = false },
|
||||||
|
makeBreadcrumbItem("Bill", label: label).with{ $0.link = "https://www.verizon.com/" },
|
||||||
|
makeBreadcrumbItem("Billing statement FAQs", label: label).with{ $0.link = "https://www.verizon.com/"; $0.selectable = true }
|
||||||
|
]
|
||||||
|
setupPicker()
|
||||||
|
setupModel()
|
||||||
|
}
|
||||||
|
|
||||||
|
override func setupForm(){
|
||||||
|
super.setupForm()
|
||||||
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
|
addFormRow(label: "Last Crumb Selected", view: selectedSwitch)
|
||||||
|
|
||||||
|
selectedSwitch.onChange = { [weak self] sender in
|
||||||
|
guard let self else { return }
|
||||||
|
self.component.selected = !self.component.selected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupPicker(){
|
||||||
|
|
||||||
|
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.surface = item
|
||||||
|
self?.contentTopView.backgroundColor = item.color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupModel() {
|
||||||
|
//setup UI
|
||||||
|
surfacePickerSelectorView.text = component.surface.rawValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user