Search code examples
iosxcodensintegeruistepper

Make UIStepper increase increment by 5


Is there a way to make a UIStepper count by 5's rather than a single increment at a time? i.e, tap + and a label says 5, 10, 15, 20, etc. or subtract by 5 every time? So far I have tried value +5; and that doesn't work. Any help is gladly appreciated. Thanks!


Solution

  • Do [<insertsteppername> setStepValue:5];

    For example:

    UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(120,20,0,0)];
    [stepper setStepValue:5];