0

There's a NSSlider with code as following

- (IBAction)sliderChanged:(id)sender {
NSSlider *slider = sender;
NSInteger value = slider.integerValue;
NSLog(@"%ld",value);
}

Because I set slider.continuous = YES;, NSLog will print in real time, this is right, and I need to add more, except the feature above, I want to get the value when the change is finished, any ideas? Thanks a lot.

Willeke
  • 14,578
  • 4
  • 19
  • 47
Mark
  • 53
  • 7

1 Answers1

-1

UISlider is a subclass of UIControl, You can add target and its action for event UIControlEventTouchUpInside. xib1

- (IBAction)sliderChanged:(id)sender{
UISlider *slider = sender;
NSLog(@"sliderChanged Value = %ld",(long)slider.value);
}

- (IBAction)sliderFinished:(id)sender{
UISlider *slider = sender;
NSLog(@"sliderFinished Value = %ld",(long)slider.value);
}
S Chauhan
  • 1
  • 5