ios - Is there a way to programmatically change the value of a UIStepper based on a calculation? -
let's have 3 uistepper
s.
when change value of one, values of other steppers change based on formula.
stepper 1 value 10.
stepper 2 value 5.
stepper 3 value 3.
if change stepper 10 +/- 1, might change value in stepper 2 +/- one.
is possible?
it absolutely possible.
you can imagine scenario:
uistepper *stepperone = [[uistepper alloc] initwithframe:frame]; [stepperone addtarget:self action:@selector(stepperonechanged:) forcontrolevents:uicontroleventvaluechanged]; - (void)stepperonechanged:(uistepper*)stepperone{ //this method called on target of first stepper on uicontroleventsvaluechanged //decrease value 1 steppertwo.value --; //or //increase value 1 steppertwo.value ++; }
Comments
Post a Comment