2014-11-14 49 views
0

我有一个UISlider,通过在CGRect中设置x值使UISlider.value使得UIImageView从一侧移动到另一侧。我想检测滑块什么时候停止,这样我就可以有另一个动作发生。如何检测UISlider何时停止,然后编写if语句来做其他事情。检测UISlider何时结束Xcode

+1

可能重复:http://stackoverflow.com/questions/ 954498 /在-UIKit的,如何做 - 检测 - 当-A-uislider-已-停止移动的,但是,也 - 不被-RELE – 2014-11-14 15:27:39

回答

0

我发现,所有我需要做的是添加

[zoomSlider addTarget:self action:@selector(stopSlider) 
     forControlEvents:UIControlEventTouchUpInside]; 

的IBAction为内我滑块,然后添加

-(void) stopSlider;{ 

    with whatever code I wanted to happen when I stop touching the slider here 
}