Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to invoke action on UISlider drag release

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 3.38k
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: