Saturday, 27 February 2016

how to get and change value of slider stepper Ios/iphone

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.slider.minimumValue = 0;
    self.slider.maximumValue = 100;

    self.stepper.minimumValue = 0;
    self.stepper.maximumValue = 100;
    self.stepper.stepValue = 1;

    self.slider.value = 10;
    self.stepper.value = 10;

}

- (IBAction)stepperValueChanged:(UIStepper *)sender {

    [self.slider setValue:sender.value];

    self.myTextLabel.text = [@((int)sender.value) stringValue];

}

- (IBAction)sliderValueChanged:(UISlider *)sender {

    [self.stepper setValue:sender.value];

    self.myTextLabel.text = [@((int)sender.value) stringValue];
}