diff --git a/VDSSample/ViewControllers/ButtonGroupViewController.swift b/VDSSample/ViewControllers/ButtonGroupViewController.swift index 60bc010..6e7a062 100644 --- a/VDSSample/ViewControllers/ButtonGroupViewController.swift +++ b/VDSSample/ViewControllers/ButtonGroupViewController.swift @@ -202,12 +202,13 @@ class ButtonGroupViewController: BaseViewController { extension ButtonGroupViewController: ComponentSampleable { static func makeSample() -> ComponentSample { let component = Self.makeComponent() + let onClick: (ButtonBase) -> Void = { button in print("\(button.text!) clicked")} component.buttons = [ - Button().with{ $0.use = .secondary; $0.text = "Secondary" }, - Button().with{ $0.use = .primary; $0.text = "Primary" }, - TextLink().with { $0.size = .large; $0.text = "Large Text Link" }, - TextLink().with { $0.text = "Widge Label Button" }, - TextLinkCaret().with { $0.text = "Text Link Caret" } + Button().with{ $0.use = .secondary; $0.text = "Secondary"; $0.onClick = onClick}, + Button().with{ $0.use = .primary; $0.text = "Primary"; $0.onClick = onClick }, + TextLink().with { $0.size = .large; $0.text = "Large Text Link"; $0.onClick = onClick }, + TextLink().with { $0.text = "Widge Label Button"; $0.onClick = onClick }, + TextLinkCaret().with { $0.text = "Text Link Caret"; $0.onClick = onClick} ] return ComponentSample(component: component)