I'm trying to handle a tap event on a segmented control, but when the selected button is clicked again. For example, for the screenshot below where "Second" is already selected, how do I handle the action when the "Second" button is clicked again?
I tried an IBOutlet
, but it only triggers when the value has changed. Then I tried the code below, but the same thing where it triggers only when the value changes. In both cases while "Second" is selected, clicking "Second" again does not fire anything. Is there a way to do this?
segmentedControl.addTarget(self, action: "segementedAnyTap:", forControlEvents: .AllEvents)
This works for me, adding a gesture recogniser to the UISegmentedControl