ios - Is there a way to programmatically change the value of a UIStepper based on a calculation? -


let's have 3 uisteppers.
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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -