views:

864

answers:

2

I have a UIControl subclass for a custom slider type control (one that behaves differently from UISlider). At the moment I use my own target and action variables to send a message to the target whenever the slider value changes. But this doesn't play nice with Apple's UIControlEvent constants. I wasn't sure if I should use these, and if so, where can I put my custom "value changed" detection?

I overrode beginTrackingWithTouch: and continueTrackingWithTouch: to return YES but the action is never dispatched.

+4  A: 

Every time the value changes you call [self sendActionsForControlEvents:UIControlEventValueChanged] and the control will handle the rest.

Ben Stiglitz
This is exactly what I needed. Thanks.
hyn
A: 

How do you adjust your value and call sendActionsForControlEvents: when beginTrackingWithTouch:withEvent and continueTrackingWithTouch:withEvent are never called?

jhabbott