Styling your app

One of the great challenges in iOS development is how to do the styling if your app in a easy maintainable way.
A lot of people start by doing it in their nib or storyboards directly, but they quickly find the limitations: no way to set custom fonts in your components, no way to refer any kind of global variables for things like background color or image, standard offsets etc…

My favourite approach at the moment is to set all these values by code on viewDidLoad methods using the help of category methods on UIFont, UIColor, UIImage, UIFont and others.

To help in more tricky styling I sometimes use the Paint Code App (Apple should copy some  of the ideas here to their IB editor)

Recently I found a very powerful alternative: Pixate. This tools is a iOS framework that allows you to style your interface using CSS files. It even allows download and applying of style files while the application is running! I’m seriously considering giving it a go it for my next project.





%d bloggers like this: