UISlider events

前端 未结 4 2100
轮回少年
轮回少年 2021-02-05 09:12

I\'m using an UISlider, its updated automatically except the user is touching the sliderbutton. therefore i did this in the function which updates automatically by an NSTimer:

4条回答
  •  春和景丽
    2021-02-05 09:58

    Better way to track if the user is done interacting with UISlider is to use continuous flag.

    If you want to trigger slider action only after the action is complete and user has moved his finger off it then use

    [blurSlider  addTarget:self action:@selector(blurSliderChanged) forControlEvents:UIControlEventValueChanged];
        blurSlider.continuous = NO;
    

    Otherwise by default its set to YES.

    [blurSlider  addTarget:self action:@selector(blurSliderChanged) forControlEvents:UIControlEventValueChanged];
        blurSlider.continuous = YES;
    

提交回复
热议问题