Skip to content

Add delegate function "ShouldChange" #99

@Oggerschummer

Description

@Oggerschummer

Hi,
may I propose some enhancement:
It would be beneficial to have a delegate function like "shouldChange" with Bool result that gets called just before any state change (selected, unselected) happens triggered form UI.
In case the delegate returns false, no change happens and the box stays as it is.
Default behaviour: Allow changes.
Something similar is available e.g. for UITextField.
I have situations, where I need to run checks or calculations before allowing to switch the state. In addition the state sometimes is populated from a popup where multiple entries are required to allow the state become true - clicking on the checkbox with this delegate function would allow me to trigger the popup easily and avoid the user being able to manually check the box.
Would keep things simple and avoid having to work with additional gesture recognizers above the box.
Regards
Oggerschummer

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions