I’ve recently discovered the simple beauty of [UIColor clearColor] used for a background color. Previously I had been doing stuff like:
self.opaque = NO;
self.backgroundColor = nil;
self.clearsContextBeforeDrawing = YES;
But all I really needed to do was:
self.backgroundColor = [UIColor clearColor];
Same transparency, and I’m guessing (hoping?) that it might be a bit more efficient (unless of course, the innards look for clear color and effectively do what I used to).
Hey, even if it’s not more efficient, it’s certainly simpler to type and it seems to have the same effect!
Sadly, this is one thing I didn’t figure out on my own, but rather spied in some other sources, but I wanted to throw it out there for ‘all uh yous’.
{ 1 comment… read it below or add one }
Nice trick
Your story has been published at http://www.iPhoneKicks.com