We might face situation where we need to do something after slider is released. This may be some code that takes a bit long to execute or makes a request to server or invokes a secondary thread or any such code executing continuously with slider drag which is not possible or may produces unexpected behavior.
So we cannot execute it on Value Changed event of the slider.
Therefore to get the action of slider released we can make an IBAction and map it to both the Touch Up Inside and Touch Up Outside events on xib.
We can make it possible Programmatically by using following Code mentioned below:
[slider addTarget:self action:@selector(sliderReleasedMethod:) forControlEvents:UIControlEventTouchUpInside]
[slider addTarget:self action:@selector(sliderReleasedMethod:) forControlEvents:UIControlEventTouchUpOutside];
0 Comment(s)