Search code examples
iphoneiosuisegmentedcontrol

How to handle events of multiple segmented control in a single view


I have 2 segmented controls in my viewcontroller view. How can I handle the tap events of both of the segmented controllers?


Solution

  • Set the tag property on each segmented control to a different integer. Then in your method you set as the action for when the value changes, check which integer the tag property is set to using [sender tag].