I want to add a graphics effect / gradient, I have in a class for a UIView. I've chosen the class in the interface builder.
However now I'd like to re use it for a tableview. It won't let me select the same class for a tableview in interface builder.
I don't want to have to duplicate my drawing code, how can I move this?
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
Instead overriding drawRect you can use build-in layer shadow methods (in your subclass):