I need to keep track of the previously selected segment of a UISegmentControl. Is there a delegate method I could use? Maybe something like selectedSegmentShouldChange:? The only delegate method I have been able to find is segmentedControl:selectedSegmentChanged:. This delegate is one step after the one I need.
I need to keep track of the previously selected segment of a UISegmentControl. Is
Share
There is not an API for handling this situation. I instead had to work with a simple FIFO buffer to keep track of the last selected segment. Here is the code for my
PreviousItemobject:An example of it’s usage: