Been wanting something like this for a long time.
Some might say it's a nasty hack, but in certain situations I can see this totally coming in handy. I work on a product regularly that needs to facilitate complex communication between remote web view content and local native code, and boy, I really wish I'd known about this library back when I started that project.
GAViewStyling which is a neat little library letting you style
UIView objects with
CSS style declarations.
I see this type of stuff a lot in other people's code:
UIImage *image = [UIImage imageWithContentsOfFile:@"lolcats.jpg"];
CGSize imageSize = image.size;
It's certainly not wrong, but you are incurring a huge performance and memory usage hit just to get the width and height of an image. Enter the
As of iOS 4, the SDK includes a better solution in the form of the
CGImageSource... set of functions, which have been available on the Mac since forever. These functions allow you to access certain image metadata without having to load the actual pixel data into memory.
Ole Begemann has put together a great article explaining the ways around such performance hits, and how you can get pretty much any metadata you could want about an image, without incurring a performance or memory usage hit.
I always find it fun to try to spot all the tiny design differences in Apple's user interfaces whenever a new update comes out.
A blog called Design Archive has put together some comparison shots of iOS 4 and iOS 5 highlighting some of the more fun differences. Normally I would quote the site I'm linking to, but this one is in Japanese, and Google Translate doesn't exactly offer grammatically readable sentences either, so here's a few of the fun ones they found:
I love that Apple's designers revisit things like this so often.