-->

Detect second click on a segment

2019-07-28 17:33发布

问题:

According to the documentation, the event which should related to UISegmentedControl is value changed. Assuming I have a segmented control with previous and next, in my case I should be able to click next more than one time, the default behaviour of UISegmentedControl will not recognize the successif second click on same segment. SO how to deal with that?

回答1:

Set the momentary property of your UISegmentedControl to TRUE.

You can do that in code or in Interface Builder (there is a checkbox in the Attributes Inspector).