diff --git a/VDSSample/ViewControllers/TemplateViewController.swift b/VDSSample/ViewControllers/TemplateViewController.swift index 40bbbe0..f543d46 100644 --- a/VDSSample/ViewControllers/TemplateViewController.swift +++ b/VDSSample/ViewControllers/TemplateViewController.swift @@ -17,8 +17,13 @@ struct TestLayoutModel: Modelable { // var molecules : [any Modelable] = [] var checkbox: DefaultCheckboxModel var radioButtonGroup: DefaultRadioButtonGroupModel - + var subscribers = Set() init(){ + let labelAction = LabelAttributeActionModel(location: 31, length: 10) + labelAction.action.sink { + print("clicked on the word 'conditions'") + }.store(in: &subscribers) + //add the checkbox checkbox = DefaultCheckboxModel() checkbox.labelText = "Terms and conditions" @@ -27,8 +32,9 @@ struct TestLayoutModel: Modelable { LabelAttributeUnderline(location: 11, length: 10), LabelAttributeStrikeThrough(location: 22, length: 5), LabelAttributeColor(location: 31, length: 10, color: UIColor.blue.hexString!), - LabelAttributeActionModel(location: 31, length: 10){ print("clicked on the word 'conditions'") }, - LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!) + LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!), + labelAction + ] checkbox.errorText = "Error Text" @@ -42,8 +48,8 @@ struct TestLayoutModel: Modelable { LabelAttributeUnderline(location: 11, length: 10), LabelAttributeStrikeThrough(location: 22, length: 5), LabelAttributeColor(location: 31, length: 10, color: UIColor.blue.hexString!), - LabelAttributeActionModel(location: 31, length: 10){ print("clicked on the word 'conditions'") }, - LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!) + LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!), + labelAction ] var radio2 = DefaultRadioButtonModel()