Friday, August 10, 2012

Setting defaults for UIView subclasses

Hey! Cool! You can set default fonts and stuff for UIView subclasses using something fancy called the appearance proxy. You ask the class for the proxy like this;

[UILabel appearance]

And then set whatever values on that you want, like


[[UILabel appearance] setFont:[UIFont fontWithName:@"Miso-Bold" size:15]];

Then any UILabel you make will be created with the font Miso Bold, instead of the default.