I have added a UISegmentedControl in my application. None of the buttons are selected in normal state. I want to implement a button click event when the first segment is selected, and another event when another button is clicked.
I have added a UISegmentedControl in my application. None of the buttons are selected
Share
If I understand your question correctly, you simply have to implement a target-action method (supported by
UIControlwhich isUISegmentedControl‘s parent class) for the constantUIControlEventValueChanged, exactly like in the example given in UISegmentControl’s reference documentation.i.e.
used for a message with the following signature:
or
for
or
for the simplest method:
which are standard types of target-action selectors used in UIKit.