Switch branches/tags
Nothing to show
Pull request Compare This branch is even with nickkuh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Example Source Code from iOS Skinning: Make your Apps Lickable!:

Tip 1: Create a CoreViewController


Apply a background image view to every view in your app, e.g.:

-(void) viewDidLoad
    [super viewDidLoad];
    UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app-background.png"]];
    [self.view insertSubview:backgroundView atIndex:0];


Tip 2: Create a "Style Sheet" = Code Organisation / Centralised Styling

StyleSheet.h and StyleSheet.m at the root of the Xcode project

+(void)styleLabel:(UILabel *)label withType:(LabelType)labelType;

+(void)styleImageView:(UIImageView *)imageView withType:(ImageViewType)imageViewType;

Example View Controller

-(void) setBirthdayLabel:(UILabel *)birthdayLabel
    _birthdayLabel = birthdayLabel;
    [StyleSheet styleLabel:_birthdayLabel withType:LabelTypeLarge];

Tip 3: UIAppearance APIs - simple yet powerful

iOS 5 Only.

New iOS 5 instance styling methods. Can also be set via global proxies.

Applied to all new class instances when UIKit class instance added to view hierarchy

Two Appearance API Proxy Methods to call on all the classes you wish to style at the point your app first launches:

[[MyClass appearance] instanceMethod:someParameter];

[[UINavigationBar appearance] setBackgroundImage:myImage forBarMetrics:UIBarMetricsDefault];


[[MyClass appearance] appearanceWhenContainedIn:[ContainerClassA class],[ContainerClassB class],nil] instanceMethod:someParameter];

[[UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class],nil] setTintColor:colour];

Tip 4:Subclass UIKit classes and use Appearance APIs

[[LargeButton appearance] setBackgroundImage:img forState:UIControlStateNormal];