I have a subclass of UIButton
where I overwrite drawRect
for a custom looking button.
But now the cell doesn\'t highlight.
How can I f
i think you can deal with the highlight problem with these methods below
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event;
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event;
- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event;
- (void)cancelTrackingWithEvent:(UIEvent *)event;
you can change the color or the image in these method
subclassing UIButton does not make sense because it's a kind of assembly/cluster class.
I had best experience creating own buttons when subclassing UIControl and add some custom behavior.
Check also this (you should not subclass UIButton).
Then also check how you highlight UIControl subclass.