Introducing Hipster Lab for iOS

Hipster Lab is a new app that I’ve been working on that allows you to create custom cartoon ‘hipsters’ that you can easily share on social networks or use as your avatar. Hipster Lab contains dozens of custom glasses, moustaches, bow ties, hats and hairstyles that - excluding the fact that you can customize the color of any element - means that you can create over 50,000,000 unique hipsters.

You can get Hipster Lab for free on the App Store today. For more technical details, please visit my main website.

These three images above show the average color of every single second of The Dark Knight trilogy.

In order to create them, I used ffmpeg to split up the movie into separate PNG files at a speed of 1 fps - representing one file per second. For each film there were around 8000 of these files.

I then wrote a simple Go program that would read each of the image files and calculate the average RGB values across the entire image. Thanks to Go’s concurrency patterns I was able to easily run 1000 of these tasks at once before generating the final images - my computer started to struggle running more than 1000 go routines at once, so it made sense to split it up into 1000 second blocks instead.

The whole project was reasonably easy to do and only took a few hours, and most of the processing time seemed to be ffmpeg rather than Go.

From the final images, I would say it is reasonably easy to discern which scenes are going on where if you are reasonably familiar with the movies.

Cake Day for iOS

I launched Cake Day a couple of weeks ago, but chose not to mention it too much because I’m waiting on Apple approving the iOS 7 update (it will be out within a few days). The premise of the app is pretty simple: you get a reminder once a year on your reddit cake day and you can manage multiple accounts within the app - so you can add your friends’ usernames too and get reminders for their cake days. It also shows you a nice picture of some cake :).

You can get Cake Day on the App Store for free now.

My first Chrome extension

After doing some data visualizations on reddit over the weekend based on using text to create ‘ASCII/word circles’ that show how each letter is connected to another I made my first Chrome extension. It is basically a visualization of Markov chains.

You can get the Chrome extension from the Chrome Web Store now. Simply click the button in your toolbar to view the visualization for any web page.

Here’s my tumblr, visualized:

64-bit iPhone

Time to replace all those ints with NSIntegers, I think…

Using Wikipedia as a data source in your app using ObjectiveGumbo

ObjectiveGumbo is a really great framework that I’ve built on top of Gumbo that makes it easy to parse HTML5 content in Objective-C. Previously the repository had a couple of demos in - one that recreates markdown from HTML (OSX) and a simple Hacker News app for iPhone - however I’ve now added a Periodic Table iPad app.

This new app is different because it shows how you can use Wikipedia as a data source in your iOS app. No data about the elements is actually stored with the app - it determines all of the layout of the table and information about each element by parsing the table on this page. It also presents additional information based on the individual pages for each element:

There are obviously a few problems to fetching data directly from HTML pages rather than from an API:

  • Wikipedia could make significant changes to their HTML structure and parsing would break, preventing the app from working properly
  • It can take a couple of seconds for the app to load up the content, however this can be resolved by caching
  • There are licensing issues for some websites (Wikipedia is CC licensed, so if you were going to use this in a real app you should reference that)

If you want to look at how I’ve done this, head over to the GitHub repository for ObjectiveGumbo.

Introducing Multi Timer for iOS

Disappointed with the default Apple clock app I decided that it was high time to create a simple, easy to use app that allows you to run and save multiple timers at once.

Multi Timer makes it really easy to save timers for tasks you do regularly and allows you to run multiple instances of the same timer at once. Even if you haven’t got the app open, Multi Timer will notify you when a timer has finished. Multi Timer is especially useful in scenarios such as cooking where you might want to time individual components separately.

Once again I have used FMDB and FlatUIKit to create this app (I’m also using Crashlytics for the first time). I had considered using UI7Kit for the UI, and given that the app is so simple I probably could have done however I really like the look of FlatUIKit (especially the buttons and color schemes) and I think it provides a bit more back compatibility with previous versions of iOS. If, however, you run the app on iOS 7 it will default to normal UINavigationBars and UITabBars in order to avoid some rendering issues on iOS 7 with FlatUIKit.

When you create a timer you can optionally assign it one of 12 icons (I’m planning extra/custom icons for a future release). My normal workflow for this would have been to create the icons in Inkscape and render them to PNGs. PNGs for icons tend to be pretty small - especially when compressed with ImageOptim - however instead I created all of the icons in Opacity (which proved to be a lot nicer to use on OSX than Inkscape) and then export Quartz rendering code for the icons instead. The code isn’t super well optimised, however it kept the size of the app incredibly small (~1MB) and allows for completely resolution independent icons.

You can get Multi Timer now on iOS for $0.99/£0.69.

In-app purchase bug with ‘1000 icons’ in Keep Calm

If you’ve tried to buy the 1000 icons upgrade in the latest version of Keep Calm on your iPhone you will find that you won’t be able to. If you’ve got an iPad you can buy it on there and then restore the purchase on your phone in order to active it.

TL;DR: I’m incapable of remembering to link up IBActions from both storyboards.