Search code examples
iosuistepper

Identifying the UIStepper that triggered the event


In my view, I have two steppers that are both linked to this function

- (IBAction)stepperChanged:(UIStepper *)sender {
    int value = [sender value];

    printf("value: %d", value);
}

Is there a quick and easy way to identify which stepper triggered this event?


Solution

  • Give the stepper a tag and then check the value of the tag. You can set a tag in code or in IB.