I have a slider that on TouchUpInside and TouchUpOutside, calls the method blurPhoto
- (IBAction)blurPhoto:(id)sender {
//perform CPU intense blur
//fade blured image back in
[UIView transitionWithView: mImageView
duration:0.9f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
mImageView.image = completedBlur;
} completion:NULL];
}
However, the slider does not complete its final rendering until after the blur has completed (which takes about 1-2 seconds), making for a jumpy and sticky slider and a poor user experience. How can I make sure the slider has completed rendering in its final position before calling this function?
Edit: I have also tried using ValueChanged (continuous: NO) and it still has the same effect.
You can call the animation using a function which is executed in separate thread. Options for threading is NSThread and GDC. Currently the UI is getting blocked as the main thread is busy in executing the animations (function) requested so the UI is updated once the function is executed completely.