Is it possible to deselect a segment of the UISegmentedControl by tapping it the second time? I am currently using a UILongPressGestureRecognizer object to setSelectedSegmentIndex to UISegmentedControlNoSegment. However, I’d rather have the selected segment deselect on the second tap.
Is it possible to deselect a segment of the UISegmentedControl by tapping it the
Share
Another method is to subclass the
UISegmentedControl. For example:The above code may require further tweaking to suit individual specifications.