UISlider作为进度条一直为我们所使用,如果想获取变化的值,通过
UIControlEventValueChanged即可获取,但是如果想获取滑动开始和结束的事件需要另外两个事件:
[self.progressSlider addTarget:self action:@selector(sliderProgressChange:) forControlEvents:UIControlEventValueChanged];
[self.progressSlider addTarget:self action:@selector(sliderTouchDown:) forControlEvents:UIControlEventTouchDown];
[self.progressSlider addTarget:self action:@selector(sliderTouchUpInSide:) forControlEvents:UIControlEventTouchUpInside];