iOS: Get the final value of UISlider after user releases the finger

Yu can connect multiple actions to a single control, including a slider. In addition to the one you have for "value changed", create another method hooked up to "touch up inside", and grab the slider's value in that method.

- (IBAction)dragged:(UISlider *)sender { // value changed
    NSLog(@"here");
    // update labels continuously here
}


- (IBAction)endedDragging:(UISlider *)sender { // touch up inside
    NSLog(@"value is %f",sender.value);
    //grab the final value here
}

Add a IBAction to listen ValueChanged events and uncheck UISlider's "Continuous Updates" property from Storyboard.

Tags:

Ios

Uislider