I first released When You’ve Got Swag on Android a few months ago and to my surprise it actually ended up getting around 30,000 downloads. Over the weekend I decided that I wanted to play around with FMDB so I decided to put together a simple iOS app, and it struck me as a good time to bring the wildly ridiculous ‘swag’ images commonly found on Instagram and Tumblr over to iOS.
After having written the model code (which really is pretty simple) FMDB proved to be really awesome and I see it as reasonably likely that I will use it as an alternative to Core Data in all my apps – it was really easy to get started with, I didn’t have to write 100 lines of boilerplate code and I don’t have to worry about issues between threads as much as I did with Core Data – when I wrote Keep Calm I actually ended up with a whole extra model layer on top of Core Data to handle rendering on a separate thread (I now know that this could be easily rewritten).
The UI was all created with FlatUIKit (well not quite all, I had to use a tiny bit of UIAppearance) which proved to be just as awesome and I plan on using FlatUIKit+FMDB a lot in the future :).
To customise which words are highlighted you enter the text in block capitals (case doesn’t matter, all of the pictures are rendered with capital text anyway). I had originally planned to try and detect #hashtags, @usernames and URLs however I realised that just detecting punctuation next to capital letters would be a lot easier and more customisable. The text rendering is done using a regular expression to find characters and then an attributed string rendered with Core Text for the highlighting. I intend to add text sizing in a future release along with iPad support (the app is so simple and because it was originally written as a test app I don’t really see the need for this).