For my application I need a color picker control. I subclassed UIControl, and it works fine:

But then, I placed the color picker in a cell of a table, and now seemingly it doesn't call the touchesMoved:withEvent method. Because of that I cant "slide" the slider along the color bar. Funnily enough the touchesBegan:withEvent seems to be called, because when I tap the color bar, the slider jumps to the tapped place.
Could somebody help mo out, please? How do I have to handle moving touches like the UISlider control does?

Thanks,
DrummerB

EDIT: I've found a temporary solution. If I set the UITableView's scrollEnabled property to NO, then it works. But I wonder why the UISlider works even if scrolling is enabled...

First let me explain what happens:
The UITableView extends from UIScrollView. UIScrollView intercepts all the events to make the decision if it is a scroll or not, if not it passes the event to the subviews. (Except when you have a UIslider)

First let me explain what happens:
The UITableView extends from UIScrollView. UIScrollView intercepts all the events to make the decision if it is a scroll or not, if not it passes the event to the subviews. (Except when you have a UIslider)

The solution is to extend UITableView and override this method:

When you Extend UISlider the hitTest returns the sliderview on a touch event but not when you extend UIControl. That I can not explain.

Overriding the hitTest you can test if the point argument is inside in your view (converting to its coordinates) and Return it the view like what happens in a UISlider.

If someone know why the UISlider is an exception in this hitTest method, please tell us.

Hope this helps you people, trying to capture touches in a UITableView or UIScrollView without the interference of the scrool detection.