I\'m overriding drawRect: in one of my views and it works even without calling [super drawrect:rect]. How does that work?
- (void)drawRect:(CGRect)rect{
C
From the documentation:
"The default implementation of this method does nothing.Subclasses that use technologies such as Core Graphics and UIKit to draw their view’s content should override this method and implement their drawing code there"
Also from the documentation..
"If you subclass UIView directly, your implementation of this method does not need to call super. However, if you are subclassing a different view class, you should call super at some point in your implementation."
Link to the documentation
I am assuming, your super class is UIView. Hence it works even if [super drawrect:rect] is not called. Because the drawRect: because UIView does nothing. So it makes no difference in this case whether or not you call [super drawrect:rect].