I have implemented Vertical Slider in one of my App which extends UISlider
. when scrolling is ended/done I am sending commands to the server with the Slider values. Sometimes when I scroll fast up/down and release then slider values are getting mismatched before sending command and after sending command.
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Value of Slider before sending command=%f",self.value);
[self sendCommand]; // Here value is something else
[super touchesEnded:touches withEvent:event];
NSLog(@"Slider value after sending command=%f",self.value); // Here value changed
}
But if I place super call before sending command then everything works fine. Please explain if anyone knows why this is happening.
[super touchesEnded:touches withEvent:event];
More interesting fact is if I don't call super then also everything works well.