我正在使用以下代码来了解滑块是否正在滑动。
但是有没有更容易知道的属性或方法?
[slider addTarget:self action:@selector(touchUp) forControlEvents:UIControlEventTouchUpInside];
[slider addTarget:self action:@selector(touchUp) forControlEvents:UIControlEventTouchUpOutside];
[slider addTarget:self action:@selector(touchUp) forControlEvents:UIControlEventTouchCancel];
[slider addTarget:self action:@selector(touchDown) forControlEvents:UIControlEventTouchDown];
- (void)touchDown {
self.sliding = YES;
}
-(void)touchUp {
self.sliding = NO;
}