For a custom layout in iOS6, i have created a subclass of UINavigationBar and overridden the drawRect method. I specify the class in interface builder, because not every controller needs to have this effect. This is also the reason why i cannot use a category.
But now with iOS7, i want to use the default navigationbar and not the overriden behaviour. The code below does not work:
-(void)drawRect:(CGRect)rect
{
if([self isOS7]) {
[super drawRect:rect];
}
else {
// custom drawing
}
}
The problem is, by actually defining the drawRect, ios7 fails to correctly draw the navigation bar under the status bar. If i leave out the entire drawrect, it works (but then it doesn't work under older devices!
Any suggestions?
respondsToSelector:
somewhere... – Rob van der Veer